Hi Sujatha,

You can use org.apache.log4j.helpers.LogLog#setQuietMode(boolean mode) to
turn off error traces.

However, IMHO, there should be a mean to catch internal Log4J exceptions,
for instance, in your case, to try an alternate socket server, or to disable
the appender. A possible future improvement...

Regards,

J-F Daune
Daune Consult SPRL
Belgium

-----Original Message-----
From: Balaraman Sujatha [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 2:03 AM
To: [EMAIL PROTECTED]
Subject: Getting rid of the log4j:Error Could not connect to remote
log4j server at [localhost]


Hi,
I am using a socketappender for my application. I get this error whenever 
my socket server is not running. I want to suppress this error. How can I 
do it, is there any easy way to do this from the configuration file itself ?

Please let me know.

Thanks,
Sujatha.
-----------

log4j:ERROR Could not connect to remote log4j server at [localhost]. We 
will try again later.
java.net.SocketException: connect (code=10061)
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:306)
         at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:126)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:113)
         at java.net.Socket.<init>(Socket.java:262)
         at java.net.Socket.<init>(Socket.java:118)
         at 
org.apache.log4j.net.SocketAppender.connect(SocketAppender.java:301)
         at 
org.apache.log4j.net.SocketAppender.activateOptions(SocketAppender.java:255)
         at 
org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:247)
         at 
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java, 
Compiled Code)
         at 
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:87)
         at 
org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.jav
a:637)
         at 
org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.jav
a, 
Compiled Code)
         at 
org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigur
ator.java:502)
         at 
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:
410)
         at 
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:
436)
         at 
org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.
java:455)
         at org.apache.log4j.Category.<clinit>(Category.java:146)
         at
com.cisco.nm.xms.ctm.server.CTMServer.<clinit>(CTMServer.java:38)
         at TestServer.main(TestServer.java:18)


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to