Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #3305

Re: Inherit logging properties in ja custom jar library?

From John Smith <jsmith@yahoo.com>
Newsgroups comp.lang.java.programmer
Subject Re: Inherit logging properties in ja custom jar library?
Date 2011-04-27 16:04 +0200
Organization Metronet
Message-ID <ip97pr$thc$1@news.metronet.hr> (permalink)
References <ip686m$2i9$1@news.metronet.hr> <ip6imk$j0g$3@news.albasani.net> <ip6jg8$9tr$1@news.metronet.hr> <ip6osu$2bb$2@news.albasani.net>

Show all headers | View raw


On 26.4.2011. 17:38, Lew wrote:
> John Smith wrote:
>> Lew wrote:
>>> Have you tried this? Why not? What happened when you did?
>>>
>>
>> If I specifically put log4j.properties inside the jar file than both
>> the WS
>> application and the jar log to the defined file.
>>
>> But if I only specify logging properties for the WS application, only the
>> application writes logs to the file and jar logs are not written.
>>
>> Maybe the problem is that my jar file is in [tomcat]shared/lib
>> directory? (It
>> is purposely put there, not in WE-INF/lib)
>
> Yes, that would have it loaded via a different class loader, so the JAR
> classes are not in the inheritance hierarchy for the application classes.
>

Now I have managed to move the jar to the WEB-INF/lib of the Web 
Service, but there are no logs from the jar in the WS log file.

If I put the log4j.properties in the jar with ERROR level, on for 
example stdout than all logs (from WS, and from the jar) are being 
logged, but with the LEVEL specified in the WS log4j configuration.

It seems that the level is being overriden, but not the appender.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Find similar


Thread

Inherit logging properties in ja custom jar library? John Smith <jsmith@yahoo.com> - 2011-04-26 12:53 +0200
  Re: Inherit logging properties in ja custom jar library? Lew <noone@lewscanon.com> - 2011-04-26 09:52 -0400
    Re: Inherit logging properties in ja custom jar library? John Smith <jsmith@yahoo.com> - 2011-04-26 16:06 +0200
      Re: Inherit logging properties in ja custom jar library? Lew <noone@lewscanon.com> - 2011-04-26 11:38 -0400
        Re: Inherit logging properties in ja custom jar library? John Smith <jsmith@yahoo.com> - 2011-04-27 11:23 +0200
        Re: Inherit logging properties in ja custom jar library? John Smith <jsmith@yahoo.com> - 2011-04-27 16:04 +0200

csiph-web