logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Smith <Paul.Sm...@lawlex.com.au>
Subject RE: socketappender stacktrace, is it necessary?
Date Sun, 09 May 2004 22:32:46 GMT
This has been bugging me for ages too.. Just committed a change.  I think
it's still an ERROR level, but doesn't log the full trace.  The message
though does contain the underlying exception message, so it's still pretty
useful.  Maybe a property on the appender if you DON'T want it to nag on
error?

This could be controversial, but I'm in agreement with Jacob on this one.

cheers,

Paul Smith

> -----Original Message-----
> From: Jacob Kjome [mailto:hoju@visi.com]
> Sent: Saturday, May 08, 2004 1:41 AM
> To: Log4J Developers List
> Subject: socketappender stacktrace, is it necessary?
> 
> 
> 
> Hi everyone,
> 
> I've been using Chainsaw2 and like it quite a bit (nice work 
> guys!).  However,
> the socketappender, at least in Logj4-1.2.8, prints out a big 
> stack trace if
> nothing is listening to the socket it is appending to.  
> Wouldn't a simple
> warning suffice?  In fact, I'd report it as a "WARN" rather 
> than an "ERROR".  A
> user can determine whether or not they want to view log 
> messages being appended
> to the socket and really only need to be gently reminded of 
> the lack of the
> socket listener.  It's not like the app won't work anymore 
> which is what one
> might think after seeing "ERROR" and a huge scary stack 
> trace.  Below is what I
> see even when I'm not concerned with viewing logging.  Do you 
> think this is
> necessary to have in the server logs?  How about: "log4j:WARN 
> No socket listener
> at localhost:4445 to recieve socket appender messages. We 
> will try again later"
> with no stack trace (I apologize if this is already fixed in 
> 1.3.  I haven't had
> a chance to look; at work with no CVS access)....
> 
> 
> log4j:ERROR Could not connect to remote log4j server at 
> [localhost]. We will try
> again later.
> java.net.ConnectException: Connection refused: connect
> 	at java.net.PlainSocketImpl.socketConnect(Native Method)
> 	at java.net.PlainSocketImpl.doConnect(Unknown Source)
> 	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
> 	at java.net.PlainSocketImpl.connect(Unknown Source)
> 	at java.net.Socket.connect(Unknown Source)
> 	at java.net.Socket.connect(Unknown Source)
> 	at java.net.Socket.<init>(Unknown Source)
> 	at java.net.Socket.<init>(Unknown Source)
> 	at 
> org.apache.log4j.net.SocketAppender.connect(SocketAppender.java:195)
> 	at 
> org.apache.log4j.net.SocketAppender.activateOptions(SocketAppe
> nder.java:152)
> 	at 
> org.apache.log4j.config.PropertySetter.activate(PropertySetter
> .java:247)
> 	at 
> org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigur
> ator.java:210)
> 	at
> org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMCon
> figurator.java:140)
> 	at
> org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(D
> OMConfigurator.java:153)
> 	at
> org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElem
> ent(DOMConfigurator.java:415)
> 	at 
> org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigur
> ator.java:335)
> 	at 
> org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:781)
> 	at 
> org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurat
> or.java:666)
> 	at 
> org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurat
> or.java:616)
> 	at 
> org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurat
> or.java:584)
> 	at 
> org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator
> .java:687)
> 	at
> org.apache.log4j.servlet.InitShutdownController.initializeLog4
> j(InitShutdownController.java:215)
> 	at
> org.apache.log4j.servlet.InitContextListener.contextInitialize
> d(InitContextListener.java:265)
> 	at
> org.apache.catalina.core.StandardContext.listenerStart(Standar
> dContext.java:3805)
> 	at 
> org.apache.catalina.core.StandardContext.start(StandardContext
> .java:4321)
> 	at 
> org.apache.catalina.core.ContainerBase.addChildInternal(Contai
> nerBase.java:823)
> 	at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.
> java:807)
> 	at 
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
> 	at
> org.apache.catalina.core.StandardHostDeployer.addChild(Standar
> dHostDeployer.java:903)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at 
> org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUt
> ils.java:252)
> 	at 
> org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
> 	at org.apache.commons.digester.Rule.end(Rule.java:276)
> 	at 
> org.apache.commons.digester.Digester.endElement(Digester.java:1058)
> 	at 
> org.apache.catalina.util.CatalinaDigester.endElement(CatalinaD
> igester.java:76)
> 	at 
> org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
> 	at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndE
> lement(Unknown
> Source)
> 	at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragment
> ContentDispatcher.dispatch(Unknown
> Source)
> 	at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocu
> ment(Unknown
> Source)
> 	at 
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at 
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 	at 
> org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> 	at 
> org.apache.commons.digester.Digester.parse(Digester.java:1567)
> 	at
> org.apache.catalina.core.StandardHostDeployer.install(Standard
> HostDeployer.java:488)
> 	at 
> org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
> 	at 
> org.apache.catalina.manager.ManagerServlet.deploy(ManagerServl
> et.java:813)
> 	at 
> org.apache.catalina.manager.ManagerServlet.doGet(ManagerServle
> t.java:320)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> er(ApplicationFilterChain.java:237)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> cationFilterChain.java:157)
> 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
> rapperValve.java:214)
> 	at
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:104)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 	at
> org.apache.catalina.core.StandardContextValve.invokeInternal(S
> tandardContextValve.java:198)
> 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardC
> ontextValve.java:152)
> 	at
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:104)
> 	at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(Aut
> henticatorBase.java:540)
> 	at
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:102)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 	at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHost
> Valve.java:137)
> 	at
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:104)
> 	at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
> Valve.java:117)
> 	at
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:102)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 	at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
> gineValve.java:109)
> 	at
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:104)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 	at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
> 	at 
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.
> java:160)
> 	at 
> org.apache.coyote.http11.Http11Processor.process(Http11Process
> or.java:793)
> 	at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandle
> r.processConnection(Http11Protocol.java:702)
> 	at 
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoi
> nt.java:571)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:644)
> 	at java.lang.Thread.run(Unknown Source)
> 
> 
> Jake
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 

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


Mime
View raw message