• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Remote Logging Error

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?

Thanks
 
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
permaculture is giving a gift to your future self. After reading this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!