Results 1 to 2 of 2
  1. #1
    Datasponge is offline Member
    Join Date
    Jan 2010
    Posts
    1
    Rep Power
    0

    Default Making SyslogAppender write to ONLY 1 log

    Hello,

    I'm trying to configure a SyslogAppender to write to only 'syslog'. Currently it writes to our custom log, syslog, messages, local0. Within the syslog config file I set LOCAL0 = syslog. I thought that this would direct it to write to only syslog, but as I stated above it does not. Below is the runtime code I'm using.

    Any help would be greatly appreciated.


    SyslogAppender syslogAppender = new SyslogAppender();
    syslogAppender.setSyslogHost("localhost");
    syslogAppender.setFacility("LOCAL0");
    syslogAppender.setLayout( new PatternLayout("{%d{dd.MM.yyyy}#%d{HH:mm:ss}} {%C.%M} {%c{1}} {%m}%n") );
    syslogAppender.activateOptions();
    LOGGER.removeAllAppenders(); //remove all appenders so we can add only the appender we want next
    LOGGER.addAppender(syslogAppender); //write only to syslog

    Thanks!

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    8

Similar Threads

  1. Need help making .jar
    By yoodidoo in forum Eclipse
    Replies: 4
    Last Post: 08-03-2009, 09:57 PM
  2. Replies: 3
    Last Post: 07-15-2009, 07:10 AM
  3. Making the program
    By pheonix in forum Advanced Java
    Replies: 4
    Last Post: 04-18-2009, 07:36 AM
  4. Making a count..
    By Samgetsmoney in forum New To Java
    Replies: 15
    Last Post: 02-18-2009, 02:44 PM
  5. Help log4j SysLogAppender
    By arthik_babu in forum New To Java
    Replies: 0
    Last Post: 11-19-2007, 02:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •