Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

log4j

Thread view: 
lmestre - 02 Feb 2006 20:06 GMT
Hi,
I have a problem with log4j. I have several applications that use
log4j (different properties files).
The problem is that all of them writes in the same file which belongs
to the last application that started in the app server. Any Ideas?,

Thanks,
Oliver Wong - 02 Feb 2006 21:36 GMT
> Hi,
> I have a problem with log4j. I have several applications that use
> log4j (different properties files).
> The problem is that all of them writes in the same file which belongs
> to the last application that started in the app server. Any Ideas?,

   Do these "several applications" have a single entry point?

   - Oliver
lmestre - 02 Feb 2006 21:51 GMT
No, they have a differet one (different ears)

Oliver Wong ha escrito:

> > Hi,
> > I have a problem with log4j. I have several applications that use
[quoted text clipped - 5 lines]
>
>     - Oliver
Lasse Reichstein Nielsen - 03 Feb 2006 08:34 GMT
> Oliver Wong ha escrito:
>>> The problem is that all of them writes in the same file which belongs
>>> to the last application that started in the app server. Any Ideas?,
...
> No, they have a differet one (different ears)

Is log4j included in each ear file, or is it somehow installed
globally on the application server (perhaps as an extension for
the JVM)?
I.e., are all the applications using the same loaded class for
log4j?

/L
Signature

Lasse Reichstein Nielsen  -  lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
 'Faith without judgement merely degrades the spirit divine.'

lmestre - 03 Feb 2006 11:30 GMT
the same class
Oliver Wong - 03 Feb 2006 16:42 GMT
> the same class

   Write filters and appenders so that each appender writes to a different
file and the filters give the appenders only the log events they are
interested in.

   - Oliver
lmestre - 03 Feb 2006 17:47 GMT
Do i need to create my own class, for example
com.myorg.mypackage.MyClass
which extends for example org.apache.log4j.FileAppender? and the same
for the filter?
Is that correct?

Thanks,

Luz

Oliver Wong ha escrito:

> > the same class
>
[quoted text clipped - 3 lines]
>
>     - Oliver
Oliver Wong - 03 Feb 2006 18:25 GMT
> Do i need to create my own class, for example
> com.myorg.mypackage.MyClass
> which extends for example org.apache.log4j.FileAppender? and the same
> for the filter?
> Is that correct?

   Yes, that is the basic strategy I proposed. However, note this passage
from the Javadocs:

http://logging.apache.org/log4j/docs/api/org/apache/log4j/spi/Filter.html
<quote>
Note that Category and AppenderSkeleton, the parent class of all standard
appenders, have built-in filtering rules. It is suggested that you first use
and understand the built-in rules before rushing to write your own custom
filters.
</quote>

   - Oliver
lmestre - 03 Feb 2006 18:34 GMT
Thanks a lot!

Luz

Oliver Wong ha escrito:

> > Do i need to create my own class, for example
> > com.myorg.mypackage.MyClass
[quoted text clipped - 14 lines]
>
>     - Oliver
lmestre - 07 Feb 2006 15:25 GMT
It didn't work. I did the proposed solution and i still have the
problem because every application extends the same appender :
FileAppender

:(

Luz
Raymond DeCampo - 04 Feb 2006 21:42 GMT
>>Oliver Wong ha escrito:
>>
[quoted text clipped - 12 lines]
>
> /L

Have you tried placing a copy of log4j,jar and configuration files in
each EAR?

HTH,
Ray

Signature

This signature intentionally left blank.

lmestre - 07 Feb 2006 15:28 GMT
Have you done that?
I think that is the right solution... but I need to put other jars too
and change the server policies of the class loader .

Luz


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.