overriding java.util.logging properties in Tomcat

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

overriding java.util.logging properties in Tomcat

Eli Bishop

I've got an application that uses SLF4J for its own logging but, unfortunately, also relies on a component that uses java.util.logging.  Normally I could deal with that by using the JUL-SLF4J bridge.  However, I found that whenever I ran the app in Cargo, it ignored my configuration file (which I had set the system property "java.util.logging.config.file" to point to) and insisted on sending all the JUL output to the console.

It turns out that Cargo insists on providing its own JUL logging.properties file that comes with the Tomcat container, and defines its own java.util.logging.config.file property to point to that file-- and it adds that property after any properties that you provide, so there's no way to override it.  This behavior is implemented in AbstractCatalinaInstalledLocalContainer.invokeContainer so it applies to all Tomcat versions.  I don't know why this was done, but it's making my life a bit difficult since I don't see any way to turn off the log spew from the component that uses JUL.  Does anyone know of a workaround?

thanks--
Eli Bishop
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: overriding java.util.logging properties in Tomcat

S. Ali Tokmen
Hi Eli

You can use http://cargo.codehaus.org/Configuration+files+option to
override any configuration file you like.

Hope this helps

Cheers

S. Ali Tokmen
http://ali.tokmen.com/

My IM, GSM, PGP and other contact details
are on http://contact.ali.tokmen.com

On 8/22/13 21:21 , Eli Bishop wrote:

> I've got an application that uses SLF4J for its own logging but, unfortunately, also relies on a component that uses java.util.logging.  Normally I could deal with that by using the JUL-SLF4J bridge.  However, I found that whenever I ran the app in Cargo, it ignored my configuration file (which I had set the system property "java.util.logging.config.file" to point to) and insisted on sending all the JUL output to the console.
>
> It turns out that Cargo insists on providing its own JUL logging.properties file that comes with the Tomcat container, and defines its own java.util.logging.config.file property to point to that file-- and it adds that property after any properties that you provide, so there's no way to override it.  This behavior is implemented in AbstractCatalinaInstalledLocalContainer.invokeContainer so it applies to all Tomcat versions.  I don't know why this was done, but it's making my life a bit difficult since I don't see any way to turn off the log spew from the component that uses JUL.  Does anyone know of a workaround?
>
> thanks--
> Eli Bishop
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: overriding java.util.logging properties in Tomcat

Eli Bishop

Thanks, somewhat - that helps, but I'm not crazy about a solution that requires me to know the structure of the Cargo container, and copy settings into it that are already defined elsewhere in my app.  I'd greatly prefer to be able to tell Cargo to just not override these properties in the first place.  I don't understand the point of Cargo doing this; the preset JUL properties it's providing are not particularly useful, it would've been fine IMO to just let it fall back to the system defaults if you haven't set the system property.


On Aug 22, 2013, at 2:20 PM, S. Ali Tokmen wrote:

> Hi Eli
>
> You can use http://cargo.codehaus.org/Configuration+files+option to
> override any configuration file you like.
>
> Hope this helps
>
> Cheers
>
> S. Ali Tokmen
> http://ali.tokmen.com/
>
> My IM, GSM, PGP and other contact details
> are on http://contact.ali.tokmen.com
>
> On 8/22/13 21:21 , Eli Bishop wrote:
>> I've got an application that uses SLF4J for its own logging but, unfortunately, also relies on a component that uses java.util.logging.  Normally I could deal with that by using the JUL-SLF4J bridge.  However, I found that whenever I ran the app in Cargo, it ignored my configuration file (which I had set the system property "java.util.logging.config.file" to point to) and insisted on sending all the JUL output to the console.
>>
>> It turns out that Cargo insists on providing its own JUL logging.properties file that comes with the Tomcat container, and defines its own java.util.logging.config.file property to point to that file-- and it adds that property after any properties that you provide, so there's no way to override it.  This behavior is implemented in AbstractCatalinaInstalledLocalContainer.invokeContainer so it applies to all Tomcat versions.  I don't know why this was done, but it's making my life a bit difficult since I don't see any way to turn off the log spew from the component that uses JUL.  Does anyone know of a workaround?
>>
>> thanks--
>> Eli Bishop
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: overriding java.util.logging properties in Tomcat

S. Ali Tokmen
Hi Eli

Implementation done: https://jira.codehaus.org/browse/CARGO-1220

You can use
http://cargo.codehaus.org/Maven2+Plugin+Installation#Maven2PluginInstallation-snapshots
for testing it.

Cheers

S. Ali Tokmen
http://ali.tokmen.com/

My IM, GSM, PGP and other contact details
are on http://contact.ali.tokmen.com

On 8/23/13 00:04 , Eli Bishop wrote:

> Thanks, somewhat - that helps, but I'm not crazy about a solution that requires me to know the structure of the Cargo container, and copy settings into it that are already defined elsewhere in my app.  I'd greatly prefer to be able to tell Cargo to just not override these properties in the first place.  I don't understand the point of Cargo doing this; the preset JUL properties it's providing are not particularly useful, it would've been fine IMO to just let it fall back to the system defaults if you haven't set the system property.
>
>
> On Aug 22, 2013, at 2:20 PM, S. Ali Tokmen wrote:
>
>> Hi Eli
>>
>> You can use http://cargo.codehaus.org/Configuration+files+option to
>> override any configuration file you like.
>>
>> Hope this helps
>>
>> Cheers
>>
>> S. Ali Tokmen
>> http://ali.tokmen.com/
>>
>> My IM, GSM, PGP and other contact details
>> are on http://contact.ali.tokmen.com
>>
>> On 8/22/13 21:21 , Eli Bishop wrote:
>>> I've got an application that uses SLF4J for its own logging but, unfortunately, also relies on a component that uses java.util.logging.  Normally I could deal with that by using the JUL-SLF4J bridge.  However, I found that whenever I ran the app in Cargo, it ignored my configuration file (which I had set the system property "java.util.logging.config.file" to point to) and insisted on sending all the JUL output to the console.
>>>
>>> It turns out that Cargo insists on providing its own JUL logging.properties file that comes with the Tomcat container, and defines its own java.util.logging.config.file property to point to that file-- and it adds that property after any properties that you provide, so there's no way to override it.  This behavior is implemented in AbstractCatalinaInstalledLocalContainer.invokeContainer so it applies to all Tomcat versions.  I don't know why this was done, but it's making my life a bit difficult since I don't see any way to turn off the log spew from the component that uses JUL.  Does anyone know of a workaround?
>>>
>>> thanks--
>>> Eli Bishop
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>    http://xircles.codehaus.org/manage_email
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email