logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Deboy <scott.de...@gmail.com>
Subject Re: log4j e java ws
Date Fri, 17 Apr 2009 15:49:35 GMT
When customizing logging configurations for signed Web Start apps, I usually
have a default logging configuration in the jar, but check the file system
in $userhome/.applicationdir for a logging configuration file.  If the file
exists in that $userhome/.applicationdir location, I load that configuration
file via DOMConfigurator.configureAndWatch(URL).  If the file doesn't exist,
I use the default logging configuration in the jar.

Note, you need to do this logging configuration discovery logic early in
your application load process, ahead of any loggers (I'd probably do the
discovery in a static code block in your main class and make sure to not
define a static logger in that class).


Scott

Chainsaw is a signed Web Start app, so you can access the file system (which
we do to write & read preferences, configuration files, etc).

On Fri, Apr 17, 2009 at 7:55 AM, Jacob Kjome <hoju@visi.com> wrote:

> I've not written a WS deployed application, but Log4j's Chainsaw 2 uses a
> custom Log4j configuration file that is outside any WS deployed jar file.
> You might have a look at it.  Hopefully the core Chainsaw developers will
> comment here as well.
>
> Jake
>
>
>
> On Fri, 17 Apr 2009 09:16:54 +0200
>  Luca Ferrari <fluca1978@infinito.it> wrote:
>
>> Hi all,
>> I'm curious about the deploying of a java web start application and log4j.
>> I mean, log4j has a configuration file (that can be included in a jar, as
>> well) that should be accessible for configuration (so should be outside the
>> jar), but ws do not allow you to store folders and files outside the
>> required jars. Therefore I'd like to know how do you decide to deploy a
>> log4j based ws application. Any suggestion?
>>
>> Luca
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message