You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Luca Ferrari <fl...@infinito.it> on 2009/04/17 09:16:54 UTC

log4j e java ws

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


Re: log4j e java ws

Posted by Luca Ferrari <fl...@infinito.it>.
On Friday 17 April 2009 17:49:35 Scott Deboy's cat walking on the keyboard 
wrote:
> 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.
>

Uhm...interesting, but this requires your application to manually test for a 
configuration file and for choosing which configuration file to use. Is there 
a way to automate this in any kind of way? For instance instrumenting the ws 
application to search for a locale config file before searching in the jar?


Thanks,
Luca

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: log4j e java ws

Posted by Scott Deboy <sc...@gmail.com>.
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 <ho...@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 <fl...@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
>
>

Re: log4j e java ws

Posted by Jacob Kjome <ho...@visi.com>.
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 <fl...@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