SMTP Appender behaviour.

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

SMTP Appender behaviour.

Philip Denno
I have a logging system that contains two appenders. First is the
RollingFileAppender for debug statements, info statements and warn
statements. Second is an SMTP appender for errors and fatal messages.

Both work fine however when I send a Throwable to the SMTPAppender the
output does not have any carriage returns in it?

I am using outlook as my mail client and this is what the output looks
like:

------------------------------------------------------------------------
-----------------------------
2005-05-20 08:45:21,039 FATAL Mentor Communication Thread could not be
created
java.net.ConnectException: Connection refused: connect at
java.net.PlainSocketImpl.socketConnect(Native Method) at
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305) at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at
java.net.Socket.connect(Socket.java:452) at
java.net.Socket.connect(Socket.java:402) at
java.net.Socket.<init>(Socket.java:309) at
java.net.Socket.<init>(Socket.java:124) at
com.tsi.proxy.server.utilities.CommunicationThread.<init>(CommunicationT
hread.java:38) at
com.tsi.proxy.server.MentorCommunicationThread.<init>(MentorCommunicatio
nThread.java:21) at
com.tsi.proxy.server.MentorManager.<init>(MentorManager.java:29)
at com.tsi.proxy.server.ProxyManager.<init>(ProxyManager.java:32)
at com.tsi.proxy.server.ProxyManager.main(ProxyManager.java:44)
------------------------------------------------------------------------
-----------------------------

Below is my log4j configuration file.

#-----------------------------------------------------------------------
-------------------
# Most common logging operations will be sent to the Rolling File.
#-----------------------------------------------------------------------
-------------------
# Define the name of the logger to be used for common information.
log4j.logger.com.tsi.proxy.server.ProxyLogger = DEBUG, A1
log4j.additivity.com.tsi.proxy.server.ProxyLogger = false

# Define the appenders in use by this logger.
log4j.appender.A1 = org.apache.log4j.RollingFileAppender

# Define the file which will be rolled by the application.
log4j.appender.A1.File=./testLog.log

log4j.appender.A1.MaxFileSize=10MB
# Keep one backup file
log4j.appender.A1.MaxBackupIndex=10

log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{yyyy-MM-ddHH:mm:ss}:%5p
(%c{1}:%M) - %m%n

#-----------------------------------------------------------------------
-------------------
# Need to log moves to a database for more detailed tracking, statistics
and report generation.
#-----------------------------------------------------------------------
-------------------


#-----------------------------------------------------------------------
--------------------
# Anything worse than an error will be sent to an SMTP Appender so that
someone is notified.
#-----------------------------------------------------------------------
--------------------

# Define the name of the logger to be used for the error and fatal
errors.
log4j.logger.com.tsi.proxy.server.FatalLogger = ERROR, A2
# Fatal and error messages will be sent to the file based logging as
well.
log4j.additivity.com.tsi.proxy.server.FatalLogger = false

log4j.appender.A2 = org.apache.log4j.net.SMTPAppender
log4j.appender.A2.Threshold = ERROR
log4j.appender.A2.To = [hidden email]
log4j.appender.A2.From = [hidden email]
log4j.appender.A2.Subject = SERIOUS PROBLEM WITH XML PROXY
log4j.appender.A2.SMTPHost = VTEXCHANGE
log4j.appender.A2.BufferSize = 1
log4j.appender.A2.layout = org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern =%d %-5p %m%n


Any help would be greatly appreciated.

Cheers,
Philip.



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: SMTP Appender behaviour.

James A. N. Stauffer
You might want to try sending it to another email address that uses
something besides Outlook.

On 5/20/05, Philip Denno <[hidden email]> wrote:

> I have a logging system that contains two appenders. First is the
> RollingFileAppender for debug statements, info statements and warn
> statements. Second is an SMTP appender for errors and fatal messages.
>
> Both work fine however when I send a Throwable to the SMTPAppender the
> output does not have any carriage returns in it?
>
> I am using outlook as my mail client and this is what the output looks
> like:
>
> ------------------------------------------------------------------------
> -----------------------------
> 2005-05-20 08:45:21,039 FATAL Mentor Communication Thread could not be
> created
> java.net.ConnectException: Connection refused: connect  at
> java.net.PlainSocketImpl.socketConnect(Native Method)   at
> java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)    at
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)   at
> java.net.Socket.connect(Socket.java:452)        at
> java.net.Socket.connect(Socket.java:402)        at
> java.net.Socket.<init>(Socket.java:309) at
> java.net.Socket.<init>(Socket.java:124) at
> com.tsi.proxy.server.utilities.CommunicationThread.<init>(CommunicationT
> hread.java:38)  at
> com.tsi.proxy.server.MentorCommunicationThread.<init>(MentorCommunicatio
> nThread.java:21)        at
> com.tsi.proxy.server.MentorManager.<init>(MentorManager.java:29)
> at com.tsi.proxy.server.ProxyManager.<init>(ProxyManager.java:32)
> at com.tsi.proxy.server.ProxyManager.main(ProxyManager.java:44)
> ------------------------------------------------------------------------
> -----------------------------
>
> Below is my log4j configuration file.
>
> #-----------------------------------------------------------------------
> -------------------
> # Most common logging operations will be sent to the Rolling File.
> #-----------------------------------------------------------------------
> -------------------
> # Define the name of the logger to be used for common information.
> log4j.logger.com.tsi.proxy.server.ProxyLogger = DEBUG, A1
> log4j.additivity.com.tsi.proxy.server.ProxyLogger = false
>
> # Define the appenders in use by this logger.
> log4j.appender.A1 = org.apache.log4j.RollingFileAppender
>
> # Define the file which will be rolled by the application.
> log4j.appender.A1.File=./testLog.log
>
> log4j.appender.A1.MaxFileSize=10MB
> # Keep one backup file
> log4j.appender.A1.MaxBackupIndex=10
>
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> log4j.appender.A1.layout.ConversionPattern=%d{yyyy-MM-ddHH:mm:ss}:%5p
> (%c{1}:%M) - %m%n
>
> #-----------------------------------------------------------------------
> -------------------
> # Need to log moves to a database for more detailed tracking, statistics
> and report generation.
> #-----------------------------------------------------------------------
> -------------------
>
>
> #-----------------------------------------------------------------------
> --------------------
> # Anything worse than an error will be sent to an SMTP Appender so that
> someone is notified.
> #-----------------------------------------------------------------------
> --------------------
>
> # Define the name of the logger to be used for the error and fatal
> errors.
> log4j.logger.com.tsi.proxy.server.FatalLogger = ERROR, A2
> # Fatal and error messages will be sent to the file based logging as
> well.
> log4j.additivity.com.tsi.proxy.server.FatalLogger = false
>
> log4j.appender.A2 = org.apache.log4j.net.SMTPAppender
> log4j.appender.A2.Threshold = ERROR
> log4j.appender.A2.To = [hidden email]
> log4j.appender.A2.From = [hidden email]
> log4j.appender.A2.Subject = SERIOUS PROBLEM WITH XML PROXY
> log4j.appender.A2.SMTPHost = VTEXCHANGE
> log4j.appender.A2.BufferSize = 1
> log4j.appender.A2.layout = org.apache.log4j.PatternLayout
> log4j.appender.A2.layout.ConversionPattern =%d %-5p %m%n
>
>
> Any help would be greatly appreciated.
>
> Cheers,
> Philip.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]