You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2008/05/06 23:21:56 UTC

DO NOT REPLY [Bug 44945] New: SyslogAppender not working

https://issues.apache.org/bugzilla/show_bug.cgi?id=44945

           Summary: SyslogAppender not working
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Appender
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: smendenh@redhat.com


I've tried with the latest 1.2.14 and 1.2.15 and the SyslogAppender does not
appear to be working in either one.

/etc/syslog.conf contains LOCAL7.* /var/log/jboss.log

Java code:
[code]
public class Test {

        static Logger logger = Logger.getLogger(Test.class);

        public static void main(String[] args) {

                PatternLayout pattern = new PatternLayout();
                pattern.setConversionPattern("[%d{ABSOLUTE},%c{1}] %m%n");

                ConsoleAppender console = new ConsoleAppender();
                console.setName("CONSOLE");
                console.setLayout(pattern);
                console.setTarget(ConsoleAppender.SYSTEM_OUT);
                //console.setWriter();
                console.setThreshold(Priority.DEBUG);

                SyslogAppender syslog = new SyslogAppender();
                syslog.setName("SYSLOG");
                syslog.setSyslogHost("localhost");
                syslog.setFacility("LOCAL7");
                syslog.setFacilityPrinting(true);
                syslog.setLayout(pattern);

                console.activateOptions();
                syslog.activateOptions();

                logger.addAppender(console);
                logger.addAppender(syslog);

            logger.info("Test message.");
        }
}
[/code]

Messages are logged to the console as expected but nothing gets logged to the
syslog.

-Samuel
Internal ref: 176164


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 44945] SyslogAppender not working

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44945

Curt Arnold <ca...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME

--- Comment #5 from Curt Arnold <ca...@apache.org> 2010-02-13 19:44:17 UTC ---
Marking as works for me.  Really sounds like syslogd is not configured to
listen on a network port.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 44945] SyslogAppender not working

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44945


Curt Arnold <ca...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|45527                       |




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 44945] SyslogAppender not working

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44945


Thorbjørn Ravn Andersen <th...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |45527




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 44945] SyslogAppender not working

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44945





--- Comment #4 from Samuel Mendenhall <sm...@redhat.com>  2008-05-07 12:58:00 PST ---
Created an attachment (id=21933)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21933)
Syslog.conf with added facility


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 44945] SyslogAppender not working

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44945


Samuel Mendenhall <sm...@redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smendenh@redhat.com




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 44945] SyslogAppender not working

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44945


Curt Arnold <ca...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




--- Comment #1 from Curt Arnold <ca...@apache.org>  2008-05-07 00:01:17 PST ---
Most likely you have not configured your syslogd to accept network connections. 

The log4j SyslogAppender is pure Java code so it performs a "network" log even
if logging to local host.  There is an existing enhancement (bug 27363) request
for a native SyslogAppender.  Unless there is something else going on, this
should be marked as a duplicate of that bug.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 44945] SyslogAppender not working

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44945





--- Comment #3 from Samuel Mendenhall <sm...@redhat.com>  2008-05-07 12:57:34 PST ---
Created an attachment (id=21932)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21932)
Reproduction code


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 44945] SyslogAppender not working

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44945


Samuel Mendenhall <sm...@redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW




--- Comment #2 from Samuel Mendenhall <sm...@redhat.com>  2008-05-07 12:56:16 PST ---
I haven't changed anything in syslog from the default installation.  From all
indications and wikis/knowledgebases on the net I was not aware there was
anything necessary to do with syslog beyond adding the facility and location to
log to.  I just tested again and it is a no go, can you verify it does in fact
work ?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org