logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Follender, Ivan" <Ivan.Follen...@hbo.com>
Subject RE: log4j MDC in Weblogic 6.1 server
Date Tue, 29 Oct 2002 23:54:12 GMT
I'm not quite sure I totally follow your response...but I'll try to
clarify...

-We have multiple EARs, each with totally independent components - they are
separate applications.
-Our loggers are not following the convention of being named after the class
name.  The names are more like 'web' and 'server' in each application.
-Everything is running in the Weblogic 6.1 JVM, but there are many threads
that Weblogic seems to control on a request basis, not an application basis.
So multiple requests within a single application are not necessarily in the
same thread hierarchy.

Solutions so far:
-each application can have its own log4j.properties
	1. write the output to different files for each application
	2. hardcode the application name in the log4j.properties
PatternLayout so it appears
		in each message

I thought using the MDC would be cooler, but it doesn't seem to be
applicable in this situation.
Using the NDC to print the user name with each request thread worked like a
champ!

Thanks,
ivan.

-----Original Message-----
From: Pomytkin, Sergey [mailto:sergey.pomytkin@attws.com]
Sent: Tuesday, October 29, 2002 4:13 PM
To: 'Log4J Users List'
Subject: RE: log4j MDC in Weblogic 6.1 server


I'm not sure that get you problem strait.
You have multiple EARs with same or partially same components? (I guess so,
or you problem in not following convention on naming loggers after class
names )
You insert Message in JSP/Servlet and it's get lost in ....
Servlet->EJB on same EAR and even on separate WAR/JAR but same JVM woks (on
WLS 6.1) so, how you manage to lost it?


-----Original Message-----
From: Follender, Ivan [mailto:Ivan.Follender@hbo.com] 
Sent: Monday, October 28, 2002 11:43
To: 'log4j-user@jakarta.apache.org'
Subject: log4j MDC in Weblogic 6.1 server


Hi-

I have multiple applications (EARs) running in a Weblogic 6.1 server.

I want the log message for each application to be 'stamped' with the name of
the application.

I am using a log4j ConsoleAppender to log all messages for all applications
to the Console.

I tried using the the Message Diagnostic Context (MDC), but the threads for
a particular application in Weblogic do not necessarily appear to be from a
single thread lineage.  So when I put something in the MDC in one
application thread, it is not necessarily there in a later thread.

Any recommendations on how to stamp each message with the application name?

Thanks,
ivan.

--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


==============================================================================
This e-mail is intended only for the use of the addressees.  Any copying, forwarding, printing
or other use of this e-mail by persons other than the addressees is not authorized.  This
e-mail may contain information that is privileged, confidential and exempt from disclosure.
 If you are not the intended recipient, please notify us immediately by return e-mail (including
the original message in your reply) and then delete and discard all copies of the e-mail.
 Thank you.




--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message