> Okay -- so my next question is -- what 's the easiest way to get my
> program to ignore that log4j.properties file? (I don 't really want
> to use my own file -- I just want to configure it inHi -- I removed my ConsoleAppender and just call BasicConfigurator()
with no parameters and I STILL get that extra line.
Here 's the code
public class MyApp
Are you sure about that? I thought that only happened with
BasicConfigurator.configure() (no params).
Add <code >appender </code > to the root category.
@(protected) appender TThe BasicConfigurator already creates and configures a ConsoleAppender
automatically so the other one that you are adding is doubling up. (The
output with the time is your appender is your one I thHi all-- (I 'm a new user so please forgive).
Here 's my simple program
In the paragraph beginning 'Loggers may be assigned levels. ' it goes on to
say 'Although we do not encourage you to do so you may define your own
levels by sub-classing the Level class. A perhaI 've been reading through documentation on log4j and thought I understood
how everything works. But there is something I 'm missing.
Since several of the Jakarta libraries seem to log to the rooThank you Jacob/Jake this helped a lot.
I need to send formatted message in email.
I am using SMTPAppender and using System.getProperty( "line.seperator ")
to get newline characters.
However the email text does not contain newline Thanks Jake.
> > > hoju@(protected) 08/Nov/2003 01 21 31 am > > >
getting resources from WEB-INF is specific to a servlet application.
you need to get the config file from both places then put I 'd like to only log debugging messages if a warning or error occurs
shortly afterwards. In the past I 've written my own logging systems
that have cached messages and then logged the last x debug mAt 08 40 AM 11/10/2003 -0500 you wrote
>One more question about the use of " <level > " element.
>What is its parent element?
<logger > or <root > (which is the root <logger >)
Can we have a mixture of loggers in log4j.xml file ?
Some of the loggers are actual classes in the application
<logger name "a.b.c.Test " >
One more question about the use of " <level > " element.
What is its parent element?
Also I thought that one controls the level at which logging
should start by using <appender > 's <param >I know there is a parameter which can be used to specifiy that log4j
must reload a configuration file (checking every so often). But I prefer
autoconfiguration. AFAIK it is not possible to set autHello
I am using log4j 1.2.8 (under JBoss). I 'm having a problem with
one of my Appenders logging to multiple log files even though I
didn 't configure it to do this.
Here is how I configure
getting resources from WEB-INF is specific to a servlet application. If
you need to get the config file from both places then put your config file
back into WEB-INF/classes/config. At that poHi
You have to add java environment log4j.debug true (-Dlog4j.debug true)
in server 's jvm settings.
Hope it helps
Von Andreas Bothner [ MTN - InnoHi
I am using LogLog to debug a startup class for weblogic in which I want
to set the RepositorySelector but the LogLog messages are not being
displayed in stdout.... I am not using a loggerJake
Using your suggestion I have able to make my Log4j servlet reading the
correct properties in /WEB-INF/config dir.
I know this is a bit out of track but in another java bean file I am
It would help if you actually obtained your servlet context. Right now it
ServletContext context this.getServletContext()
At 10 47 AM 11/7/2003 +1100 you wrote
Thank you for your time. I have made the changes to the code as you
have suggested. It compiled without problem. However it does not seems
to initiate the Log4j Tag Library. Have I missed
You need to look at my code closer. "context " is a ServletContext. You
can use it to access stuff anywhere in the webapp.
URL url context.getResource( "/WEB-INF/config/log4j.properties ")
Putting the properties file under /web-inf/config is what I really
wanted to achieve but I am not be able to make it work. I uses the
following to initialised the log4j package.
I am a new log4jj user. As part of a Proof of Concept I am trying to log a
simple message to an Oracle 9is Database.
Due to my inexperience and lack of documentation here is the only example
The fqcn parameter is only used to correctly extract caller 's location
information (class name file name line number). The fqcn parameter is not
At 03 24 If I use log(fqcn level message throwable) to generate a log event which
% parameter do I use to display the fqcn in my formatted logging event? No
matter what I pass as fqcn it appear to dis
I 'd listen to Yoav here and keep your libs with each app. However I 'm
wondering why this isn 't working for you. What does your repository
selector use to distinguish different logger repositoAt 11 29 AM 11/5/2003 +1100 you wrote
>I am using the Log Tag Library 1.0 from Jakarta Project.
>In the Installation document it suggest that in order to initialize
>Log4j automatically the 1. how can the same log output be sent to two syslogs and a file?
2. I am running JUnit and my Application. They both use log4j
Just running the application all is logged in the