• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Log4J NTEventLogAppender configuration through properties file

 
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've cracked my brain over this searching online and can't find any decent documentation.

I know how to programmatically setup NTEventLogAppender to log to remote NT servers.

However, how do I do it through the properties config file?

The problem is NTEventLogAppender only accepts argument "server" string in the constructor, and there's no setters for it.

I doubt the following will work:
log4j.appender.ntEventLogAppender=org.apache.log4j.nt.NTEventLogAppender
log4j.appender.ntEventLogAppender.source=mysource
log4j.appender.ntEventLogAppender.server=192.168.1.1 // probably fail here due to missing setter?
 
Marshal
Posts: 25798
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean, you can't find decent documentation? You have the source code! Although I have to say, the API docs are pretty useless apart from telling you what methods exist.

If you need a setServer() method then you could write a subclass that has one.
 
Justin Chu
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for suggestion.

I saw a post on log4j dev forum that NTEventLogAppender maybe removed due to lack of support.
 
    Bookmark Topic Watch Topic
  • New Topic