Return-Path: Delivered-To: apmail-logging-log4cxx-user-archive@www.apache.org Received: (qmail 57371 invoked from network); 26 Feb 2006 13:14:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Feb 2006 13:14:05 -0000 Received: (qmail 14866 invoked by uid 500); 26 Feb 2006 13:14:04 -0000 Delivered-To: apmail-logging-log4cxx-user-archive@logging.apache.org Received: (qmail 14630 invoked by uid 500); 26 Feb 2006 13:14:03 -0000 Mailing-List: contact log4cxx-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4CXX User" List-Id: Delivered-To: mailing list log4cxx-user@logging.apache.org Received: (qmail 14619 invoked by uid 99); 26 Feb 2006 13:14:03 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Feb 2006 05:14:03 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [151.189.21.42] (HELO mail-in-02.arcor-online.net) (151.189.21.42) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Feb 2006 05:14:02 -0800 Received: from mail-in-05-z2.arcor-online.net (mail-in-05-z2.arcor-online.net [151.189.8.17]) by mail-in-02.arcor-online.net (Postfix) with ESMTP id 9B78D1C6169 for ; Sun, 26 Feb 2006 14:13:40 +0100 (CET) Received: from mail-in-03.arcor-online.net (mail-in-03.arcor-online.net [151.189.21.43]) by mail-in-05-z2.arcor-online.net (Postfix) with ESMTP id 8DF5D19EE19 for ; Sun, 26 Feb 2006 14:13:40 +0100 (CET) Received: from [192.168.1.111] (dslb-084-056-237-232.pools.arcor-ip.net [84.56.237.232]) by mail-in-03.arcor-online.net (Postfix) with ESMTP id 4B07B1590DD for ; Sun, 26 Feb 2006 14:13:40 +0100 (CET) Message-ID: <4401A971.4050300@apache.org> Date: Sun, 26 Feb 2006 14:13:21 +0100 From: Andreas Fester User-Agent: Debian Thunderbird 1.0.7 (X11/20051019) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Log4CXX User Subject: Re: Newbie Question: No appenders could be found References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Yang Xiang wrote: > I have a C++ app which was compiled and linked with log4cxx. I am using > the default configuration > > log4j.rootLogger = DEBUG, A1 > log4j.appender.A1 = org.apache.log4j.ConsoleAppender > log4j.appender.A1.layout = org.apache.log4j.PatternLayout > log4j.appender.A1.layout.ConversionPattern = t-%-60c%m%n I used your configuration with the sample application "examples/trivial" and it works quite well: t-root debug message t-root info message t-root warn message t-root error message t-root fatal message What I did is to remove the call to BasicConfigurator::configure() in the trivial.cpp example, and created a file log4j.properties in the examples directory which contains exactly your configuration. If you do not call any Configurator, log4cxx looks for the files log4cxx.properties, log4cxx.xml, log4j.properties and log4j.xml in the current directory and uses them. Alternatively you can call PropertyConfigurator::configure(LOG4CXX_FILE(PathToYourConfigFile)) to have better control over which file is used. > But it gives me error on my app startup: > No appenders could be found for logger > (mrw.fn.__gnu_cxx.__common_pool_policy<__gnu_cxx.__pool, > true>._S_get_pool). > Please initialize the log4cxx system properly. > Could not instantiate class [org.apache.log4j.ConsoleAppender]. > Class 'org.apache.log4j.ConsoleAppender' not found > Could not instantiate appender named "A1". > > Do I need to install log4j classes in order to instantiate a console Definitely not :-) > appender? All I need is for log4cxx to printout debug information to a > file. That should be simple, just start with the trivial.cpp example shipped with log4cxx... Best Regards, Andreas