logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pramodh Peddi" <ppe...@IMPRIVATA.com>
Subject SyslogAppender with tcp
Date Mon, 09 Apr 2007 19:50:04 GMT

I am using log4j for logging and doing syslogging to the localhost using
SyslogAppender. I am NOT using configuration/XML file to specify log4j
settings. I am using java code to provide settings. Things are working
fine except that I want to use tcp while syslogging. I am assuming
default is UDP protocol for syslogging. Is there any way I can specify
log4j to use tcp using java code (not in xml/configuration)? 

This is my current java code for syslog initialization....



    private void initSyslog(){



            PatternLayout layout = new PatternLayout("%d| %c %-6p [%t]:

            SyslogAppender syslogApp = new SyslogAppender(layout,
SyslogAppender. LOG_LOCAL0);//[1]




        }catch(Exception e){

            System.out.println("Unable to configure SyslogAppender");





[1] Should I use different constant/syslogfacility? If so what? 

Is there any other way to make the syslogappender explicitly use tcp?






  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message