You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Geoff Meakin <sh...@gmail.com> on 2013/10/08 16:00:01 UTC

Override logging

I've been asked to host a couple of tomcat thirdparty webapps which all
have either logging.properties or log4j configurations (internally).

My question is, as a sysadmin who only gets to run the tomcat container,
can I override all the logging configurations of my apps. For example, I
dont use disks to log, I use syslog, and want to force all tomcat logs to
go over syslog.

I've read all the docs on JULI and log4j, and my head has exploded, and I
appreciate there are ways to do this in the properties file of the app
itself. However, I can't change the apps, and want to override all at the
container level. Is this possible? I can't imagine that it wouldn't be.

Hope this isn't too much of a n00b question.

Re: Log4J2 and Tomcat (Was: Override logging)

Posted by Jordan Michaels <jo...@viviotech.net>.
On 10/08/2013 12:27 PM, Christopher Schultz wrote:
> Interested in giving it a try?

I wouldn't mind. I'm still poking at 1.2 a bit to see if I can make it 
work for this project, but yeah, I'm happy to give it a go. =)

Warm Regards,
Jordan Michaels

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Log4J2 and Tomcat (Was: Override logging)

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Jordan,

On 10/8/13 2:54 PM, Jordan Michaels wrote:
> Interesting that you're bringing this up, I'm researching similar
> things for a project. Specifically, I'm looking over the
> documentaiton at the bottom of the page here regarding log4j: 
> http://tomcat.apache.org/tomcat-7.0-doc/logging.html
> 
> ...and log4j 1.2.9 seems to work great. Has anyone tried this same 
> method with the upcoming log4j2? IE: would the current
> tomcat-juli.jar, and tomcat-juli-adapters.jar work with log4j2?

Probably not. I haven't looked at the auto-detection code that
Tomcat's "full Apache Commons Logging implementation [which is] thus
is able to discover the presense of log4j and configure itself" uses,
but I suspect it will require some tweaks before you can switch. It
will likely require the use of log4j-1.2-api.jar as well.

Interested in giving it a try?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSVFyLAAoJEBzwKT+lPKRYty4QAMtoONKoQOWkzAw8smyGTHJX
GCpyqNsKnEQnkhnk+Vah7lcl0JAC51NW8riGCh2I2Yb08XJODhXN8qu5a5WsbloH
15GcXGlUKffhASWqmbHgTC+cRemTkVEKyp7fOZzIfI/vW0fG7lvYn1nKUhnhVNej
0C2ryHFxJxY3xffX5MwJGfM6hhVMPonopk9eoFKCBaJqxeDLsJVO9mti8oX07Vu4
tusI1gjWMGK0upXBwkFdu8mvQwehy94/W5ALt3tdmI5egm+i625Mwjlt92XA480f
0kSku45MD2l+EXd0p/Wg6rq3/FAxhspEcUEEfwF3ywJFzC5wSq48jhy7RoLKmB34
3zQyYuJARBgp/4Sj+7U1Iw1VSGu6qi6I4iq2AhxILExPAACSvW3IxsJH1bZDCOCp
O8xDV9HHwSLqRUMvXalvs9tmSJ1DbQpmz3VPqTn2Lb6+toxJXaJZ2/yEu0VtngyR
TyavmoBJ/odosIoOv7+mZ3yyVy+3M7II1Ro20bd9a3UxgEtnpKFsaLG4X5HSL2x0
AVFLzDryzkpwHzbNATql4gTg8Drb4r7D5OV6I6vLPwjoXqiJbyQA/T95tqFFzZLA
w3MKxP2Fi/GcHeeJfzddQ/mA3VWsPB93ysgaUohHec3NbofQw6ylzyofvGxYZoa5
n/oNzWPvxpcUiEaxSU6S
=hzJM
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Log4J2 and Tomcat (Was: Override logging)

Posted by Jordan Michaels <jo...@viviotech.net>.
On 10/08/2013 12:22 PM, Christopher Schultz wrote:
> Note that you are a few versions behind: log4j 1.2.x is currently at
> 1.2.17. I'm not sure if the differences between 1.2.9 and 1.2.17
> affect you.
>
> - -chris

Indeed. Thanks for pointing that out. =)

Warm Regards,
Jordan Michaels

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT x 2] Log4J2 and Tomcat (Was: Override logging)

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Jordan,

On 10/8/13 2:54 PM, Jordan Michaels wrote:
> Interesting that you're bringing this up, I'm researching similar
> things for a project. Specifically, I'm looking over the
> documentaiton at the bottom of the page here regarding log4j: 
> http://tomcat.apache.org/tomcat-7.0-doc/logging.html
> 
> ...and log4j 1.2.9 seems to work great. Has anyone tried this same 
> method with the upcoming log4j2? IE: would the current
> tomcat-juli.jar, and tomcat-juli-adapters.jar work with log4j2?
> 
> Just curious mostly, I'm pretty happy with log4j 1.2.9 as it is.
> As usual, the Tomcat and log4j dev teams have done amazing work
> there.

Note that you are a few versions behind: log4j 1.2.x is currently at
1.2.17. I'm not sure if the differences between 1.2.9 and 1.2.17
affect you.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSVFtcAAoJEBzwKT+lPKRYuYoP/jGvaOtLccQvXISM9zpOB5me
Ik59a5vfB6WFsIk0u6T969b+223yWyddEQ5iKCjpjFEJrmy8dWONmQDeGFpQ/IS3
aJQmR49XHSeyn5tkM2kLip4Zvo7IFB5zrvvlzuAWYKsaj7j4Zb1AJ1hiITDmGPCf
p+Pf5mtJiPVulMVGIQLYeYJJP7uqRKe4Zu/za7aUVpjcpCbBq4euC3LOIpKoQ/3B
2CP19KiCBuU31lMjFJ28CL1cRAdP85UvfxippkcFTnEX7KZp1SukrECUBy9aoemm
qXanNldNUbEw8JeRWqj9q39W0Rv69ivdx/hSuojyxB8zrNqH2ptOpUsz2uRWHqlv
zqVkJFrIcVBmZf8tqh6XdcZSTl2PsI86pEFKsYwZo4KgvWYajyIQlPqCMyfsi3Cr
nNEFdM3XOnMfzFdvCMP6daXd6KHz9PxkaO+9QzUc8FUx+RU3vaLVaTNB/NmIZmz0
Ss/7zNoUe9qLgznax9/mTEW1JhDUeZAy9lbefMyrTaQEVj98fUACQtqTTGkvgg9X
T/jM6RP58ebUSyP1Gw6djz/db3VbHT+8XmaTaQx6nAFWMTw4kfJJhXh71lRhSOM+
AhSl002JlM0aYbNJVgEEmbdUhIOsHnN+I+BLI+62RHXrq/T1NBhVWbHiFUqhcE2R
pF9G43Ye8tCzdq17RBNC
=yScl
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Log4J2 and Tomcat (Was: Override logging)

Posted by Jordan Michaels <jo...@viviotech.net>.
Interesting that you're bringing this up, I'm researching similar things 
for a project. Specifically, I'm looking over the documentaiton at the 
bottom of the page here regarding log4j:
http://tomcat.apache.org/tomcat-7.0-doc/logging.html

...and log4j 1.2.9 seems to work great. Has anyone tried this same 
method with the upcoming log4j2? IE: would the current tomcat-juli.jar, 
and tomcat-juli-adapters.jar work with log4j2?

Just curious mostly, I'm pretty happy with log4j 1.2.9 as it is. As 
usual, the Tomcat and log4j dev teams have done amazing work there.

Warm Regards,
Jordan Michaels

On 10/08/2013 07:00 AM, Geoff Meakin wrote:
> I've been asked to host a couple of tomcat thirdparty webapps which all
> have either logging.properties or log4j configurations (internally).
>
> My question is, as a sysadmin who only gets to run the tomcat container,
> can I override all the logging configurations of my apps. For example, I
> dont use disks to log, I use syslog, and want to force all tomcat logs to
> go over syslog.
>
> I've read all the docs on JULI and log4j, and my head has exploded, and I
> appreciate there are ways to do this in the properties file of the app
> itself. However, I can't change the apps, and want to override all at the
> container level. Is this possible? I can't imagine that it wouldn't be.
>
> Hope this isn't too much of a n00b question.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Override logging

Posted by Cédric Couralet <ce...@gmail.com>.
2013/10/8 André Warnier <aw...@ice-sa.com>:
> Geoff Meakin wrote:
>>
>> I've been asked to host a couple of tomcat thirdparty webapps which all
>> have either logging.properties or log4j configurations (internally).
>>
>> My question is, as a sysadmin who only gets to run the tomcat container,
>> can I override all the logging configurations of my apps. For example, I
>> dont use disks to log, I use syslog, and want to force all tomcat logs to
>> go over syslog.
>>
>> I've read all the docs on JULI and log4j, and my head has exploded, and I
>> appreciate there are ways to do this in the properties file of the app
>> itself. However, I can't change the apps, and want to override all at the
>> container level. Is this possible? I can't imagine that it wouldn't be.
>>
>
> +1
>
>
>> Hope this isn't too much of a n00b question.
>>
>
> No, it isn't. It is a very good question, very relevant to people such as
> you (and I) who mostly have to manage tomcats rather than developing apps
> for tomcat.
>
>

Did you happen to try something with sl4j ? That would be my first try
: get all application logging to sl4j and then manage it as I want.

I don't even know if it is possible at all, and you will probably have
to touch the web app to replace the libraries used by sl4j bridge.

I'm also greatly interested if you find something usable.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Override logging

Posted by André Warnier <aw...@ice-sa.com>.
Geoff Meakin wrote:
> I've been asked to host a couple of tomcat thirdparty webapps which all
> have either logging.properties or log4j configurations (internally).
> 
> My question is, as a sysadmin who only gets to run the tomcat container,
> can I override all the logging configurations of my apps. For example, I
> dont use disks to log, I use syslog, and want to force all tomcat logs to
> go over syslog.
> 
> I've read all the docs on JULI and log4j, and my head has exploded, and I
> appreciate there are ways to do this in the properties file of the app
> itself. However, I can't change the apps, and want to override all at the
> container level. Is this possible? I can't imagine that it wouldn't be.
> 

+1

> Hope this isn't too much of a n00b question.
> 

No, it isn't. It is a very good question, very relevant to people such as you (and I) who 
mostly have to manage tomcats rather than developing apps for tomcat.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org