RE: Tomcat logging with Log4j

2014-04-18 Thread Scott Bailey
Sorry,
 I'm not sure why you want to log to the console (stdout), but it looks like 
 you've managed to do it.
I think is was put in a long time ago (in a bad way) and never changed to a 
better way.


Our developers changed

statusListener class=ch.qos.logback.core.status.OnConsoleStatusListener/
appender name=STDOUT class=ch.qos.logback.core.ConsoleAppender
encoder class=ch.qos.logback.core.encoder.LayoutWrappingEncoder
layout 
class=com.donlen.common.utility.logging.DefaultAlignedLayout/
/encoder
/appender


To this in our logback.xml


statusListener class=ch.qos.logback.core.status.OnConsoleStatusListener/
appender name=STDOUT class=ch.qos.logback.core.rolling.RollingFileAppender
filelogFile.log/file
rollingPolicy 
class=ch.qos.logback.core.rolling.TimeBasedRollingPolicy
  !-- daily rollover --
  fileNamePatternlogFile.%d{-MM-dd}.%i.log/fileNamePattern
maxHistory180/maxHistory
  timeBasedFileNamingAndTriggeringPolicy
   class=ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP

   maxFileSize100MB/maxFileSize
  /timeBasedFileNamingAndTriggeringPolicy
/rollingPolicy
encoder
  pattern%date [%thread] %-5level %logger{35} - %msg%n/pattern
/encoder
/appender



-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: Thursday, April 17, 2014 4:41 PM
To: Tomcat Users List
Subject: Re: Tomcat logging with Log4j

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Scott,

On 4/16/14, 10:15 AM, Scott Bailey wrote:
 I was able to get one of our developers and it was simple for them to
 add the logging for our app to the logback we are using a file and add
 logging rotation. My issue is resolved. Thanks for the help though.

Glad to hear you got your issue fixed, though you didn't actually tell us how 
it was fixed. It would help others if you would explain what you had to do to 
fix this.

I'm not sure why you want to log to the console (stdout), but it looks like 
you've managed to do it.

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

iQIcBAEBCAAGBQJTUEp7AAoJEBzwKT+lPKRYh1IQALT16jdmdy0HvjEIW2NS638b
7NyAmq/VamC2bYMcSwnpc3Zb2MpyJBkpG/dpfEIq14yYf9oqw9veC55hczrTI2YB
Fov95SLzH1e0fnH5tBWTxfS7xGxImv+pI3691gMMElCeR35yrGeNuhdM9sPB22IY
+JjOuX8gDTkI3m5Jq1r2UWe4inLjOneZp3sk5C7esxG8DV4yHUe6C5MFr0+RxsbH
ofZQaaOi+x2PH79vk28YSPB+7OTHf156UhSohFF8jHT5ue1vwl6XqaABjLy79z6Q
ZtCIfudTzKU31FMRJWarD4glHNkKfs+3t6Hw/VKnl6NeS+GnVQYvLDpxhfuKG9Ar
akwQipRaoeudFJSXIu39U8YgrJBYTQFVgMjt4aH3eIdXPhpkC7/hMhuQ2kdXRfgw
pW4L9s2nwaCXN13IOcOOS4CgaXkfXr+DVi7W+zZPVPK0AYmraOCDLrpaRwBJXQvW
5TTqCAfU1SmYDsPrSIjpwFzE4sq8GododUm8lWL2zH+BfOLXFI2Pboy2ji3vpVHU
CKiPhgB+N7zezULlwhZ09gmZOLLb3zBg6q/oFzTwZC9oCX5AN0ziEzi00lLgWf5Q
6y2AN/0zvGv2MziWvWZCrOzL6yyKEscdH5S9O0M1r6FF/BKRH8V95Y7emdnX5ShT
M9cojCEJ9nl3LMzZ697s
=hPD6
-END PGP SIGNATURE-

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

DISCLAIMER: This electronic mail message and any attached files contain 
information intended for the exclusive use of the intended addressee and may 
contain information that is proprietary, privileged, confidential and/or exempt 
from disclosure under applicable law. If you are not the intended recipient, 
you are hereby notified that any viewing, copying, disclosure or distribution 
of this information may be subject to legal restriction or sanction. Please 
notify sender if you are an unintended recipient and delete the original 
message without making copies. Thank you.


RE: Tomcat logging with Log4j

2014-04-16 Thread Scott Bailey
I was able to get one of our developers and it was simple for them to add the 
logging for our app to the logback we are using a file and add logging 
rotation. My issue is resolved. Thanks for the help though.

-Original Message-
From: Scott Bailey [mailto:sbai...@donlen.com]
Sent: Tuesday, April 15, 2014 3:15 PM
To: Tomcat Users List
Subject: RE: Tomcat logging with Log4j

Hello Christopher,
 What steps did you actually take?
Steps on this site: 
http://mrhaki.blogspot.com/2011/02/configure-log4j-on-tomcat.html

Downloaded new jars from extras for tomcat. tomcat-juli.jar and 
tomcat-juli-adapters.jar. Placed the tomcat-juli.jar file in our 
$CATALINA_BASE/bin directory. The file tomcat-juli-adapters.jar is copied to 
our $CATALINA_BASE/lib directory.
Downloaded the latest log4j 1.2 library from the download page and copied to 
the $CATALIN_BASE/lib directory.
Added the Log4j configuration file as it is on the link above. Disable the old 
Tomcat JUL logging configuration by deleting logging.properties Placed the 
Log4j configuration file. In the $CATALINA_BASE/lib directory


I am not a java person but I believe we are using logback is what our java 
developers say, we do not state what files to log to but what to log and I 
think Tomcat logged it to the log file.

statusListener class=ch.qos.logback.core.status.OnConsoleStatusListener/
appender name=STDOUT class=ch.qos.logback.core.ConsoleAppender
encoder class=ch.qos.logback.core.encoder.LayoutWrappingEncoder
layout 
class=com.donlen.common.utility.logging.DefaultAlignedLayout/
/encoder
/appender


Thanks!



-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: Tuesday, April 15, 2014 2:22 PM
To: Tomcat Users List
Subject: Re: Tomcat logging with Log4j

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Scott,

On 4/15/14, 2:50 PM, Scott Bailey wrote:
 We need to add log rotation and log size management to tomcat 7.
 Tried converting to Log4j steps from tomcat website
 (http://tomcat.apache.org/tomcat-7.0-doc/logging.html) but did not
 work, was able to get it to work from
 (http://mrhaki.blogspot.com/2011/02/configure-log4j-on-tomcat.html).


It seems we are not getting any logging from our webapp though, and
 prior to this change it was getting logged in stdout and stderr.

What steps did you actually take?

 Does something need to be changed in log4j.properties to still capture
 stdout and stderr to log file with Log4j?

How are you logging from within your application? ServletContext.log()?

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

iQIcBAEBCAAGBQJTTYbNAAoJEBzwKT+lPKRYHB4P/RUlDHyT2wQTt41S0YB/VbCR
leQxOtDJYeO3WZ3qERNP1yzmX3GW2xKfxy8+5yXAgmPugO4LXbW2sj7a4VEDuR3D
l5a/AkjqvsEdJFvWAB/77NFzWvcbOfiBT5Iw8AdkoprzaitdsD7UelLA7OlLbSCr
EnLp1ZQmVJHEdAaFc0Rr2tH7SY1oSFZM19wmihBPTFZsOfnssiEnDnO6zhxgl9kG
IlvNNuadefd0TxUiaNsncNYQatGjNsWHsjf6miYcEuJ2ZEz8x0YBzZv60MP0qiVi
U/YvkvQCwGJU9wYvK9SjKpmJrunnB2dt3zKL724+qCw4D8h7qcccq6yytBXGRDha
x4847oIbkvG7fqtljQTjfefuh8fFKalEVR8LP3huQtHqkpT4YRnRhJifFwZQmz1E
aj7h/dz91F5pWmN673Fs8aO5LAM8qvsk7sT89QtBle0REeFZFEGPqGwBsDDV4sgE
Shnr4JuR+xVyGCInHzV/zMDJ4EtVZVHRNFUnG9zS9Q5+FWfiOVc4cqxb4s6NgRKg
mVhC8qharbzt/3I0nLNtMIxbz8c7hB2zNGBgjaQHEZ8BNp0+p3MtEOz9fGywi0pR
CEL+HtjWbfaV+O8d3HSLyQMqtT5/ZOm10ZBG0s1yFjhaoxwz3yUjLLu2G3TeGJeD
rRzHvGKrkAwWRehs+Zgm
=g0p8
-END PGP SIGNATURE-

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

DISCLAIMER: This electronic mail message and any attached files contain 
information intended for the exclusive use of the intended addressee and may 
contain information that is proprietary, privileged, confidential and/or exempt 
from disclosure under applicable law. If you are not the intended recipient, 
you are hereby notified that any viewing, copying, disclosure or distribution 
of this information may be subject to legal restriction or sanction. Please 
notify sender if you are an unintended recipient and delete the original 
message without making copies. Thank you.
B CB  [  
X  ܚX KK[XZ[
 \ \  ][  X  ܚX P X ]
 \X K ܙ B  ܈Y][ۘ[  [X[  K[XZ[
 \ \  Z[ X ]
 \X K ܙ B
DISCLAIMER: This electronic mail message and any attached files contain 
information intended for the exclusive use of the intended addressee and may 
contain information that is proprietary, privileged, confidential and/or exempt 
from disclosure under applicable law. If you are not the intended recipient, 
you are hereby notified that any viewing, copying, disclosure or distribution 
of this information may be subject to legal restriction or sanction. Please 
notify sender if you are an unintended recipient

Tomcat logging with Log4j

2014-04-15 Thread Scott Bailey
Hi all,
We need to add log rotation and log size management to tomcat 7. Tried 
converting to Log4j steps from tomcat website 
(http://tomcat.apache.org/tomcat-7.0-doc/logging.html) but did not work, was 
able to get it to work from 
(http://mrhaki.blogspot.com/2011/02/configure-log4j-on-tomcat.html). It seems 
we are not getting any logging from our webapp though, and prior to this change 
it was getting logged in stdout and stderr.

Does something need to be changed in log4j.properties to still capture stdout 
and stderr to log file with Log4j?

We are running Tomcat as a windows service on 2008 R2 with Java 7.


Thank you!

Scott






DISCLAIMER: This electronic mail message and any attached files contain 
information intended for the exclusive use of the intended addressee and may 
contain information that is proprietary, privileged, confidential and/or exempt 
from disclosure under applicable law. If you are not the intended recipient, 
you are hereby notified that any viewing, copying, disclosure or distribution 
of this information may be subject to legal restriction or sanction. Please 
notify sender if you are an unintended recipient and delete the original 
message without making copies. Thank you.


RE: Tomcat logging with Log4j

2014-04-15 Thread Scott Bailey
Hello Christopher,
 What steps did you actually take?
Steps on this site: 
http://mrhaki.blogspot.com/2011/02/configure-log4j-on-tomcat.html

Downloaded new jars from extras for tomcat. tomcat-juli.jar and 
tomcat-juli-adapters.jar. Placed the tomcat-juli.jar file in our 
$CATALINA_BASE/bin directory. The file tomcat-juli-adapters.jar is copied to 
our $CATALINA_BASE/lib directory.
Downloaded the latest log4j 1.2 library from the download page and copied to 
the $CATALIN_BASE/lib directory.
Added the Log4j configuration file as it is on the link above. Disable the old 
Tomcat JUL logging configuration by deleting logging.properties
Placed the Log4j configuration file. In the $CATALINA_BASE/lib directory


I am not a java person but I believe we are using logback is what our java 
developers say, we do not state what files to log to but what to log and I 
think Tomcat logged it to the log file.

statusListener class=ch.qos.logback.core.status.OnConsoleStatusListener/
appender name=STDOUT class=ch.qos.logback.core.ConsoleAppender
encoder class=ch.qos.logback.core.encoder.LayoutWrappingEncoder
layout 
class=com.donlen.common.utility.logging.DefaultAlignedLayout/
/encoder
/appender


Thanks!



-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: Tuesday, April 15, 2014 2:22 PM
To: Tomcat Users List
Subject: Re: Tomcat logging with Log4j

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Scott,

On 4/15/14, 2:50 PM, Scott Bailey wrote:
 We need to add log rotation and log size management to tomcat 7.
 Tried converting to Log4j steps from tomcat website
 (http://tomcat.apache.org/tomcat-7.0-doc/logging.html) but did not
 work, was able to get it to work from
 (http://mrhaki.blogspot.com/2011/02/configure-log4j-on-tomcat.html).


It seems we are not getting any logging from our webapp though, and
 prior to this change it was getting logged in stdout and stderr.

What steps did you actually take?

 Does something need to be changed in log4j.properties to still capture
 stdout and stderr to log file with Log4j?

How are you logging from within your application? ServletContext.log()?

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

iQIcBAEBCAAGBQJTTYbNAAoJEBzwKT+lPKRYHB4P/RUlDHyT2wQTt41S0YB/VbCR
leQxOtDJYeO3WZ3qERNP1yzmX3GW2xKfxy8+5yXAgmPugO4LXbW2sj7a4VEDuR3D
l5a/AkjqvsEdJFvWAB/77NFzWvcbOfiBT5Iw8AdkoprzaitdsD7UelLA7OlLbSCr
EnLp1ZQmVJHEdAaFc0Rr2tH7SY1oSFZM19wmihBPTFZsOfnssiEnDnO6zhxgl9kG
IlvNNuadefd0TxUiaNsncNYQatGjNsWHsjf6miYcEuJ2ZEz8x0YBzZv60MP0qiVi
U/YvkvQCwGJU9wYvK9SjKpmJrunnB2dt3zKL724+qCw4D8h7qcccq6yytBXGRDha
x4847oIbkvG7fqtljQTjfefuh8fFKalEVR8LP3huQtHqkpT4YRnRhJifFwZQmz1E
aj7h/dz91F5pWmN673Fs8aO5LAM8qvsk7sT89QtBle0REeFZFEGPqGwBsDDV4sgE
Shnr4JuR+xVyGCInHzV/zMDJ4EtVZVHRNFUnG9zS9Q5+FWfiOVc4cqxb4s6NgRKg
mVhC8qharbzt/3I0nLNtMIxbz8c7hB2zNGBgjaQHEZ8BNp0+p3MtEOz9fGywi0pR
CEL+HtjWbfaV+O8d3HSLyQMqtT5/ZOm10ZBG0s1yFjhaoxwz3yUjLLu2G3TeGJeD
rRzHvGKrkAwWRehs+Zgm
=g0p8
-END PGP SIGNATURE-

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

DISCLAIMER: This electronic mail message and any attached files contain 
information intended for the exclusive use of the intended addressee and may 
contain information that is proprietary, privileged, confidential and/or exempt 
from disclosure under applicable law. If you are not the intended recipient, 
you are hereby notified that any viewing, copying, disclosure or distribution 
of this information may be subject to legal restriction or sanction. Please 
notify sender if you are an unintended recipient and delete the original 
message without making copies. Thank you.


External URL delay from webapp

2014-04-02 Thread Scott Bailey
Hi all,
We are having an issue with a new tomcat deployment, in our webapp we make a 
request to a 3rd party webservice site using http URL for retrieving the data, 
the first time we click the button to make the request the information is 
returned within a second or 2 but if we click the button again within 5 seconds 
to request the information again it takes a good minute for the data to be 
returned.

We found that if we set the -Dhttp.proxyHost  and -Dhttp.proxyPort options in 
tomcat under the java options this resolves the delay but also breaks another 
request to a different 3rd party using https URL.

We are new to tomcat and we have been researching for a week with no results 
other than the proxy setting.

Thank you!
Scott
DISCLAIMER: This electronic mail message and any attached files contain 
information intended for the exclusive use of the intended addressee and may 
contain information that is proprietary, privileged, confidential and/or exempt 
from disclosure under applicable law. If you are not the intended recipient, 
you are hereby notified that any viewing, copying, disclosure or distribution 
of this information may be subject to legal restriction or sanction. Please 
notify sender if you are an unintended recipient and delete the original 
message without making copies. Thank you.


RE: External URL delay from webapp

2014-04-02 Thread Scott Bailey
Thanks André!

This is what I was suspecting too. We were using jrun prior and jrun was 
proxying for us automatically.
Unfortunately I am not really a java person and do not know how to answer the 
library question you posed.
I think we will need our java developers look in to this from java perspective.


-Original Message-
From: André Warnier [mailto:a...@ice-sa.com]
Sent: Wednesday, April 02, 2014 9:50 AM
To: Tomcat Users List
Subject: Re: External URL delay from webapp

Scott Bailey wrote:
 Hi all,
 We are having an issue with a new tomcat deployment, in our webapp we make a 
 request to a 3rd party webservice site using http URL for retrieving the 
 data, the first time we click the button to make the request the information 
 is returned within a second or 2 but if we click the button again within 5 
 seconds to request the information again it takes a good minute for the data 
 to be returned.

 We found that if we set the -Dhttp.proxyHost  and -Dhttp.proxyPort options 
 in tomcat under the java options this resolves the delay but also breaks 
 another request to a different 3rd party using https URL.


Maybe first, understand that this has nothing to do with Tomcat.  So you may 
have been looking for information in the wrong places.

It is your application making a connection to some outside endpoint, and Tomcat 
knows nothing about it.
The only thing in common between your application and Tomcat, is that they both 
run in the same JVM.
So if you set a global JVM option -D, this impacts *everything* that runs in 
that JVM :
Tomcat, other applications, and your own application.

You probably need to find a way to set these properties for your application 
only (or for that connection only).
Sadly, I don't know java well-enough to know if that is possible in this case.
What library are you using, to make that HTTP call ?  Look there first.





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

DISCLAIMER: This electronic mail message and any attached files contain 
information intended for the exclusive use of the intended addressee and may 
contain information that is proprietary, privileged, confidential and/or exempt 
from disclosure under applicable law. If you are not the intended recipient, 
you are hereby notified that any viewing, copying, disclosure or distribution 
of this information may be subject to legal restriction or sanction. Please 
notify sender if you are an unintended recipient and delete the original 
message without making copies. Thank you.

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