File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes Remote Logging Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Remote Logging Error" Watch "Remote Logging Error" New topic

Remote Logging Error

Mudit Srivastava
Ranch Hand

Joined: Apr 30, 2007
Posts: 38
Hi All,

I am currently using Log4j (V1.2.11) to log onto a remote server, through the SocketAppender. In case of any failures in writing logs, i want my calling class to raise an appropriate event for the same.

As i noticed in the log4j FAQs, Log4j FAQ, log4j will output a single message to System.err indicating that logging can not be performed.

Can any one guide me how to accomplish this ?

Paul Clapham

Joined: Oct 14, 2005
Posts: 19848

You don't like how SocketAppender works? Then since log4j is open-source, you're free to change it to work however you like. Or you could write a subclass of SocketAppender which works the way you want it to work.
Mudit Srivastava
Ranch Hand

Joined: Apr 30, 2007
Posts: 38
Initially i thought i'll use a FallbackErrorHandler, but i'm not able to retrieve the LoggingEvent object in the error method.

Thanks Paul rewriting the socketAppender seems a good option.

I agree. Here's the link:
subject: Remote Logging Error
jQuery in Action, 3rd edition