Hi all
I have a server application which can serve multiple clients. The logging
occurs in files separated by client. (BTW: This is accomplished by supplying a
own RepositorySelector which uses certain values in MDC).
Therefore the file name within the configurtion file
Darren
you must make more clear what you want to achieve:
Do you want only three different destinations (appenders) to log to?
Or do you want three different loggers, each one with his own set of appenders?
What is the kind of the desired appenders?
How do you want to distinguish the different
Hi Antoine
I dont have an example how to deal with new levels but annother point is
important while wrapping. You have to use the overloaded method log(String
callerFQCN, Priority level, Object message, Throwable t) where you pass as
first parameter the name of the wrapper class. The renderer
Hi Rajesh
it's no problem to use a stored proc, at least not if the DB is Oracle.
I have a descendent of JDBCAppender: myJDBCAppender. This class has a property
PreparedSQL, which is filled by the LogManager when initializing from
configuration file (see below).
Within the overwritten
Hi
the leading slash might be the culprit. Also ensure that the directory exists.
Heri
-Original Message-
From: Ranjan, Rajiv [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 24, 2005 10:13 AM
To: log4j-user@logging.apache.org
Subject: Log file does not gets created with log4j
Hi hein
The short answer is no.
the long answer see thread with subject File-Appender: Empty Ghost files
between 7. and 11. April of this year.
Heri
-Original Message-
From: Hein Meling [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 24, 2005 4:25 PM
To: Log4J Users List
Subject:
Where and how do you call your LoggingConfiguration class exactly?
The code private static Logger log = Logger.getLogger(Foo.Bar.class); is
called at class loading, before any real code is executed.
In one JVM there is only one LogManager which has per default only one logger
repository. So
'
Cc: Bender Heri
Subject: RE: new user question re: configuring log4j via code
I call the LoggingConfiguration class/glorified-global near the
start of the main() routine.
I use ProcessBuilder.start() to launch other classes that have their
own main() (which in turn also call
Your property file is maybe not in the classpath? Or has not the default name?
-Original Message-
From: Balaji Saranathan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 06, 2005 4:46 PM
To: log4j-user@logging.apache.org
Subject: Log4J Help requested
Hi,
I'm new to log4j
Usually I configure by XML file and I am not quite shure, but:
log4j.appender.framework.File=framework.log=./logs/framework.log
seems to have one = to much.
Did it work with your first version
log4j.appender.framework.File=framework.log ?
Heri
-Original Message-
From: Balaji
Hi
Using an own written RepositorySelector is a reasonably way of having different
logger universes within the same JVM. Using the standard selector returns
always the same logger instance for a given name, since it it is stored within
the unique default repository. A self written selector
Derive a class from ObjectRenderer and define which class should be rendered by
your new renderer:
renderer renderedClass=java.lang.String
renderingClass=foo.bar.myRenderer/
Then you overwrite the method doRender(), where you obtain the String as
parameter. Do whatever you like
Of course you can do this.
Set either the level of the logger to the desired value:
level value=warning/
or set the threshold tag of an appender:
param name=Threshold value=WARNING/
or define a filter withing an appender:
filter
Yes, Log4j creates all file immediatly when loading configuration.
I wish it would create them lazy only when first writing occurs.
Heri
-Original Message-
From: Arunkumar Soundararajan
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 06, 2005 11:10 AM
To: Log4J Users List
Cc:
Hi
If it's not a must to write into the same log file: there are several
techniques to separate the logger universes in order that the same
package/class writes to different log files. The easiest way is by using the
fact that the different apps run in different thread contexts (I assume this
Because you forgot the attribute additivity=false
BTW: you should use the new Identifier logger. category is deprecated.
logger name=com.company.a.b.c.f additivity=false
and
logger name=com.company.a.b.d.f additivity=false
Heri
-Original Message-
From: news [mailto:[EMAIL
Hi
you must define the appenders before the loggers within the config file. See
the dtd file.
Heri
-Original Message-
From: David Durham [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 13, 2005 3:06 PM
To: log4j-user@logging.apache.org
Subject: log4j xml configuration problem --
Hallo
A static member is initialized only once, at the time when the class first time
is loaded. Beside that, the call to Logger.getLogger( xyz ) delivers always the
same instance of the logger xyz. You can call this as much as you like. The
logger repository is built new on every restart of
the key the number of times it logs increases by
one...
Thank you,
Regards,
Charith I. Fernando
+94 77 3263222 (Mobile)
-Original Message-
From: Bender Heri [mailto:[EMAIL PROTECTED]
Sent: Monday, October 24, 2005 3:32 PM
To: Log4J Users List
Subject: RE: LOG4J messages
(Mobile)
-Original Message-
From: Bender Heri [mailto:[EMAIL PROTECTED]
Sent: Monday, October 24, 2005 5:07 PM
To: Log4J Users List
Subject: RE: LOG4J messages printing twice
Do you mean:
- start program
- press button
- - one log entry on console
- press button again
Elaine
Log4j has nothing to do with registry. This is java world, that means
crossplattform world. Everything is configured by files and nothing by windows
registry.
You can, of course, read registry values out from your program and configure or
reconfigure log4j by code. But that's up to
registry
values out from
my program? Elaine
-Original Message-
From: Bender Heri [mailto:[EMAIL PROTECTED]
Sent: 25 October 2005 12:12
To: Log4J Users List
Subject: RE: WELCOME to log4j-user@logging.apache.org
Elaine
Log4j has nothing to do with registry. This is java world
IIRC you can't use Filters in property files, only in xml.
Heri
-Original Message-
From: James Stauffer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 01, 2005 4:18 PM
To: Log4J Users List
Subject: Re: How to config LevelMatchFilter
I only use XML config so I don't know.
David
On 11/1/05, Bender Heri [EMAIL PROTECTED] wrote:
IIRC you can't use Filters in property files, only in xml.
Heri
-Original Message-
From: James Stauffer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 01, 2005 4:18 PM
The static approach only works if you use only one logger repository. If you
want to separate logging universes i.e. by using MDC you have to instantiate a
logger for each instance of a class. Logging statements out of static helper
routines even need fetch the correct logger inline not via a
There are situations where you cant use static members. If you separate logging
universes by using a specialzed RepositorySelector, which returns different
loggers depending on diffenrent MDC values. If the basic framework classes,
which are used in different applications (moduls), but running
The specifier t within the layout pattern renders the thread name to the
output.
I dont know how to output the thread ID.
what do you mean by some other information? You can put some values into the
MDC before calling a logging function. Within the layout you can render this
values again:
(FileAppender) Logger.getLogger( aLoggerName ).getAppender( aAppenderName
).getFile();
-Original Message-
From: Burton Strauss [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 5:10 AM
To: log4j-user@logging.apache.org
Subject: Silly ? - How do I figure out the name of the
-Original Message-
From: Bender Heri [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 3:14 AM
To: Log4J Users List
Subject: RE: Silly ? - How do I figure out the name of the file the
log is being written to?
(FileAppender) Logger.getLogger( aLoggerName ).getAppender
,test
log4j.appender.test=org.apache.log4j.DailyRollingFileAppender
log4j.appender.test.Append=false
log4j.appender.test.File=testbed.log
log4j.appender.test.layout=org.apache.log4j.SimpleLayout
-Burton
-Original Message-
From: Bender Heri [mailto:[EMAIL
Assuming your configuration is still the same (root logger with appender
test) then the call
Appender ap = LogManager.getRootLogger().getAppender( test);
should return your file appender test. Doesn't it?
If you call Logger.getLogger( Test ) you get a logger instance without any
appenders
See inline
log4j.rootLogger=info,console,file
Here you define the root logger with level info which has attached two
appenders (console and file).
log4j.logger.console=warn
This logger, called console, has level warn, but no appender attached
At the first glance I think it should work like you expect. I only ask me what
the levels ISWARN and ISDEBUG should be. Did you define them yourself? Or is
this a cpp issue? In java it would be WARN and DEBUG.
Which log file you get? If it is the second one (IS_SER_complete.log) then
probably
See below.
Yes you are right. We had to define our own log-levels
because we had to write the severity-text and the
severity-level. But I did one mistake in the example: Both
Logger use log4cplus.logger.islog. So the following two
lines are correct. Sorry.
log4cplus.logger.islog=ISWARN,
you can define as many loggers as you want within one configuration file / jvm.
The same is true for appenders. And you are free to attach whatever appender to
whatever logger. You even can attach the same appender to two or more different
loggers.
Your last question (get Logger by appender) I
of org.apache.log4j.Logger which uses the certain appender in
my xml configuration file?
Best regards,
Leon
--- Bender Heri [EMAIL PROTECTED] wrote:
you can define as many loggers as you want within one configuration
file / jvm.
The same is true for appenders. And you are free to attach
jars. But
will be deployed to one war.
Best regards,
Leon
--- Bender Heri [EMAIL PROTECTED] wrote:
Do the two services run in different thread / thread-hierarchies?
Heri
-
To unsubscribe, e-mail: [EMAIL
--- Bender Heri [EMAIL PROTECTED] wrote:
I never had to deal with jar's in war's. Therefore I don't know what
you want to say with this.
My question was if the two services are running within separate
threads within the same JVM. If this is the case, the solution would
be to use a self
Yes, it is possible.
The naming of the loggers is not forced to be class names. You can choose
whatever you want. Using class names (including package path) is just a comfort
convenience which offers a bulk of advantages.
So you are free to define 4 different loggers with distinct names and
if the first filter delivers DENY or ACCEPT, then the second filter is not
called. if the return value would be NEUTRAL, also the second filter is called.
I'm not shure, but can't you use regular expression in one filter (or'd)?
Heri
-Original Message-
From: Praveen Kumar
The output of the self written object renderer is a string. This will be
handled by the pattern like you would have put a string directly, means the %m
switch will be replaced by your string.
Heri
-Original Message-
From: Anant K [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 19,
You dont need a filter for doing this, because this is covered by the core idea
of the log4j framework.
Just define a logger named org.jboss.deployment.MainDeployer, attach the
desired file appender to this class and set the additivity flag to false. If
you don't attach the same appender to
by jboss, I'm only modifying it. I suppose that, I
can only enable a
filter using the log4j.xml file.
Thanks,
Pedro
-Original Message-
From: Bender Heri [mailto:[EMAIL PROTECTED]
Sent: quarta-feira, 1 de Fevereiro de 2006 14:39
To: Log4J Users List; [EMAIL PROTECTED]
Subject: RE
First, it's not a good idea to subclass the Logger class. Better write a
wrapper if you want to centralize some logging policies.
Your problem can be solved if you do not call the super.info() etc., but the
generic log(String callerFQCN, Priority level, Object message, Throwable t)
method. The
No. You should call it in code after having assigned new values to appender
properties.
Heri
-Original Message-
From: Rahul [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 07, 2006 3:20 PM
To: log4j-user@logging.apache.org
Subject: activateOptions() in RollingFileAppender
Hi
=Logger.getLogger(ClassName.class); which
creates a logger
instance
then
logger.info(some log);
Where should I call activateOptions() and how to invoke that
piece of code?
Bender Heri wrote:
No. You should call it in code after having assigned new
values to appender properties.
Heri
Are you shure your correct xml configuration is loaded in your GUI(web) app?
BTW what you mean with GUI(web) exactly?
Heri
-Original Message-
From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 14, 2006 2:38 PM
To: log4j-user@logging.apache.org
LOOOL...
To see what xml is loaded start your JVM (Webserver?) with the commandline
option -Dlog4j.debug
Heri
-Original Message-
From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 14, 2006 3:40 PM
To: Log4J Users List
Subject: Re: Filtering
No, this would not work since you dont know the thread id in configuration file
where you name the logger.
You must implement your own repository selector which maintains a repository
for each thread (or other distinguishing features as you like). The following
is a sample which has two
A possibility to have different logger universes in one JVM instance I have
described last week. See Thread Use different log files inside one program.
Applying this solution you can achieve your wished clientID within the
filename.
The problem of the daily log is solved at best with
Your solution was to implement a custom RepositorySelector, wasn't it?
Right.
What I can't see in your solution was the place where I set
the filename.
You've said something about getting the FileAppender?
Can you please explain?
I assume you configure your log4j framework through
see actual thread Single logfile per User and Day and the thread from last
week Use different log files inside one program.
Heri
-Original Message-
From: julie gautier [mailto:[EMAIL PROTECTED]
Sent: Monday, February 27, 2006 4:37 PM
To: log4j-user@logging.apache.org
Subject:
Does Tomcat start a separate JVM for each WEB-INF application? If not, your
suggestion would not work since Log4j is global within one JVM.
Heri
-Original Message-
From: Javier Gonzalez [mailto:[EMAIL PROTECTED]
Sent: Monday, February 27, 2006 4:47 PM
To: Log4J Users List
Subject:
to support my point ;)
But you made me remember an important point - log4j.jar must
be only inside
the contexts, and not in $TOMCAT_HOME/common/lib or
$TOMCAT_HOME/shared/lib
On 2/27/06, Bender Heri [EMAIL PROTECTED] wrote:
Does Tomcat start a separate JVM for each WEB-INF
application
Yes, since there is no timer running which triggers the rollover at a certain
point of date. Only if a new log event occurs the appender checks the date and
decides to rollover if needed.
Heri
-Original Message-
From: Dirk Ooms [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 01,
This issue was discussed last week extensively. See mail archive.
Heri
-Original Message-
From: waltz co [mailto:[EMAIL PROTECTED]
Sent: Monday, March 06, 2006 5:26 AM
To: log4j-user@logging.apache.org
Subject: different log4J log files for same application
hi,
i have an
configured all
that. Also, is
there no performance hit with all that logging from java to the db?
Rakesh
Bender Heri wrote:
I dont use log4plsql, but I have a System which logs by a
JDBC-Appender to a Oracle-Table, and the stored procedures
within Oracle log exceptions to the same
I have not noticed a performance impact, since we log only WARN, ERROR, and
FATAL into DB. And this occurs not that often.
Heri
-Original Message-
From: Rakesh Patel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 08, 2006 2:50 PM
To: Log4J Users List
Subject: Re: Using the same
Log4j is a singleton within the same JVM, more precise in each classloader of
the JVM running. So you can have only one configuration. To give more help you
must provide more details about your application and your goal.
Heri
-Original Message-
From: Asaf Lahav [mailto:[EMAIL PROTECTED]
Log4j offers you very far reaching possibilities to finetune your log output
and log destinations only by config file if you use the logging framework
within your code like it is forseen, i.e. fetching the loggers by using the
full qualified class name. Then you can configure the log level of
Hi
you are free to choose a logger's name as you like. The convenience to name the
loggers by the FQN of the surrounding class is useful for your first goal
(debugging log). To treat some special log outputs I suggest to introduce a
separate logger with a clear name, let's say UserAudit. The
The formal paramter of the log calls is Object. You can pass any object you
like. The default renderer will then call toString() of this object. If you
want to have annother rendering, you have to write your own one and declare it
in the configuration file:
renderer
Your output looks like the default toString() result. So I guess your renderer
is not called.
How looks your definition? This definition works for me:
renderer renderedClass=ch.ergonomics.pms.common.supervision.MessageLogger
param name=File value=folder/workshop_test.log /
should do the trick (slash instead of '.'). Log4j does not create folders if
they do not exist. So must assure this folder exists before initializing log4j.
Heri
-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of ks
How does your config file look?
Heri
-Original Message-
From: Zheng Wen Zhe [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 11, 2006 5:16 PM
To: 'Log4J Users List'
Subject: why my logger doesn't get executed??
Hi all,
This is my A Java class with logger resides.
My question
If you use log4j without any extras it's good practice to declare the logger as
private static final Logger myLog = Logger.getLogger( MyClass.class );
private: because every descendant in class hierarchie can have its own logger
instance (i.e. for fintuning the log levels)
static: because
its a typo an should spell CipherOutputStream. It is used in framework java
crypto extension (javax.crypto)
-Original Message-
From: xhu1 [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 14, 2006 7:24 PM
To: Log4J Users List
Subject: [SPAM (Bayesain Analysis)] - Re: Encryption of log
Hi all
I use log4j 1.2.8 in a server environement with DailyRollingFileAppenders.
Although the property Append is set to true, the logfiles are sometimes
overwritten on restart of the server application. I cannot reproduce this
problem, it just happens occasionally.
Here the excerpt of my
The problem is not that it does not roll over at midnight (this works
perfectly) but that the log file from the very same day is overwritten when
restarting the application.
Heri
-Original Message-
From: Lewis, Cory (Genworth) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 28, 2006
Imagine: Two processes own a file handle to the same file. I wonder that not
already the concurrent writing gives problems. But if one process wants to
rename the file, this can't become good in each case. (this is a OS and
Filesystem issue and not a Log4j issue).
If you want two JVM writing
It's not enough to just put it in the lib dir, you must include it in your
classpath.
Heri
-Original Message-
From: venkatlakshmi [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 29, 2006 1:55 PM
To: log4j-user@logging.apache.org
Subject: NoClassDefFound Error for
You didn't attach any appender to the loggers except the rootLogger.
It should look like this:
log4j.logger.org.apache.commons.httpclient=DEBUG, stdout
Probably you also want to set additivity of this logger to false, otherwise log
entries it would appear twice in stdout (one time by this
If you use xml configuration file you can attach one ore more self written
filter class(es):
example:
appender name=CONSOLE.OUT class=org.apache.log4j.ConsoleAppender
param name=target value=System.out/
layout class=org.apache.log4j.PatternLayout
param
Don't know if this is related to your problem, but I think you must declare the
appender before the logger (root)
Heri
-Original Message-
From: chuanjiang lo [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 06, 2006 4:54 PM
To: log4j-user@logging.apache.org
Subject: [SPAM (Bayesain
Do you use the log4j class PropertyConfigurator within your code? Then you
would have to change this to DOMConfigurator.
Heri
-Original Message-
From: chuanjiang lo [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 06, 2006 4:54 PM
To: log4j-user@logging.apache.org
Subject: [SPAM
this issue was discussed a lot on this list. Search for items
RepositorySelector, MDC, Classloader; contributions by me and Javier
Gonzalez. Titles: Use different log files inside one program, Different log
files for different web applications under Tomcat
Heri
-Original Message-
I would chose the approach by a self written renderer, which is configured like
this:
renderer renderedClass=ch.ergonomics.pms.common.supervision.MessageLogger
renderingClass=ch.ergonomics.pms.common.supervision.MessageLogger/
The rendering class is your self written renderer which
first, extending Logger class is discouraged. You should wrap the logger class
if you want to do generic work on each logger call. Best practice would be, to
pass the correct logger in each call to debug() etc. So you can benefit of
finetuning the logger output by classes and packages.
second:
I would suggest following:
PackageAppender (threshold DEBUG)
+ Filter: DENY = (event.getLoggerName() eq. com.package.class2 )
and
(event.getLevel() = DEBUG)
DebugAppender (threshold DEBUG)
Logger com.package with appender PackageAppender,
I would write a helper class with a static interface:
public boolean static isLoggingEnabled( Logger aLog, Level aLevel ) { ... }
where you check your conditions. The call within code could the look like:
NDC.push(source-ip= + request.getSourceAddress());
if
Very nice, indeed, but it doesn't apply to existing logging code neither...
Heri
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 19, 2006 6:33 PM
To: log4j-user@logging.apache.org
Subject: RE: High performance filters
I tried and
The problem is to find the appender instance. Remember that log4j holds the
instantiated loggers within a hierarchy based on the logger name where the '.'
describes a new level of the hierarchy. If you configure a logger i.e.
com.foo.bar.MyPackage and assign an appender to it (=Logger A), and
Hi
If your application is single threaded, means only one activity occurs at the
sime time, you easily can use NDC and Filters: Declare one appender per
activity which filters only the messages of the belonging activity. The needed
NDC value is set at the beginning of activity and removed at
Subclass the SMTP appender for catching any send errors and retry send the log
message to Localmachine, where a you provide a listener which logs into a file.
Heri
-Original Message-
From: Takacs Bence [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 16, 2006 2:22 PM
To: Log4J Users
Your log calls should call the generic Logger.log() method, where you pass
the FQCN of your LogWrapper. Location information are stripped away by the
log4j framework up to this passed FQCN.
logDebug(Object desc) {
logger.log( LogWrapper.class.getName(), Level.DEBUG, desc, null );
my logs to a Custom created
Event log of my own. Can you help in this regards ?
Thanks and Best Regards,
Amit Pathak
-Original Message-
From: Bender Heri [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 24, 2006 4:55 PM
To: Log4J Users List
Subject: RE: NTEventLogAppender
You have to set the additivity property of the quartz- and apache-Logger to
false. Otherwise a log request would climb up the hierarchy until root logger.
I am not quite shure about syntax in property file (I work with xml), something
like log4j.logger.org.quartz.additivity=false. You have to
You cannot set your own LoggerRepository, but your own RepositorySelector,
somewhere at the beginning of your main application:
private static Object guard = new Object();
static
{
LogManager.setRepositorySelector( new MyRepositorySelector(), guard );
}
When asking
Since you defined additivity=false on your com.schinvest Logger, the log
messages don't reach the root logger.
Your goal can be achieved by xml configuration where you can declare filters on
appenders. So you only declare a root logger with debug level and a net.sf
logger with warn level. On
declare a separate logger with your SPECIAL_APPENDER attached and additivity
flag false. You are not forced to use the classname as logger name. You can
choose any string (i.e. SPECIAL_LOGGER).
Heri
-Original Message-
From: Bryce Nesbitt [mailto:[EMAIL PROTECTED]
Sent: Thursday,
Here is an example of an xml configuration which uses filters (BTW: Using this
two appenders when debugging in eclipse the console shows the DEBUG and INFO
in black color and the others in red color). You can also write your own filter
class where you are free to filter what you want. Be
This problem arises often. Some want to separate the log files of servlets by
different criterias (sessionID, userID, etc.), others (like me) have a
scheduler which fires different tasks on different customers where the log
output should be separated.
I thought one could enhance the file
Can you explain where these characters occur? Are they within a String supplied
as msg argument in log calls? Or where?
Heri
-Original Message-
From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED]
Sent: Monday, September 18, 2006 4:02 PM
To: log4j-user@logging.apache.org
A common way to enter binary data in xml is
- use base64 encoding (not readable for humans, size is one third bigger than
original)
- translate to hex string (readable for humans, size is twice as big than
original)
Heri
-Original Message-
From: Praveen Kumar Hasthalapuram
1. It is not recommended to subclass Logger. It would be better to write a
Wrapper if you have particular business rules to implement.
2. In order to analyze your problem you should provide more details:
- original property file
- alternative property file
- name(s) of involved loggers
- Where
This was discussed a lot on this list. Search in archive, keywords: MDC,
RepositorySelector, different files.
We currently discuss on the developper list the introduction of a
MultiFileAppender which addresses just your need. But the work is still in
progress...
Heri
-Original
I assume this is a classpath issue.
How do you use your path reference? How do you load the property file?
Heri
-Original Message-
From: Ben Lajeunesse [mailto:[EMAIL PROTECTED]
Sent: Monday, October 23, 2006 4:56 PM
To: log4j-user@logging.apache.org
Subject: [SPAM (Bayesain
Already considered to use MDC?
i.e.:
MDC.put( category_tech, EJB )
MDC.put( category_func, Plan )
try
{
myLog.x
}
finally
{
MDC.remove( category_tech );
MDC.remove( category_func );
}
The pattern can resolve this MDC values with the %X switch: %X{category_tech}
%X{category_func}
partitions like
Accounts,Servicing,Plan,Infrastructure
etc, would it be possible if i use MDC values?
On 10/25/06, Bender Heri [EMAIL PROTECTED] wrote:
Already considered to use MDC?
i.e.:
MDC.put( category_tech, EJB )
MDC.put( category_func, Plan )
try
{
myLog.x
Here a example how to configure filters. Note: Filters are only available if
you use xml configuration.
appender name=CONSOLE.OUT class=org.apache.log4j.ConsoleAppender
param name=target value=System.out/
layout class=org.apache.log4j.PatternLayout
param
1 - 100 of 191 matches
Mail list logo