syslog appender

5 views
Skip to first unread message

fullWindsor

unread,
Apr 9, 2009, 11:52:06 AM4/9/09
to Log4erl
hello,

i'm trying to use the syslog appender feature of log4erl, for which i
have great expectations.

i have setup everything configured correctly, i hope:
- syslogd parameters: -m 0 -r -n
- syslog.conf set to handle facility local3.* to a file and to a
remote syslog
- log4erl.conf set to create a new logger (loggername) using the
syslog_appender, facility local3. (i have a doubt here: what's the
use of the appender's name, after syslog_appender?)

i restart syslogd, so that the conf is loaded and in an erlang
console, i do:
- application:start(log4erl).
- log4erl:conf("log4erl.conf").
- log4erl:error(loggername, "ERROR MESSAGE HERE").

unfortunately, nothing happens. nither the file nor the remote syslog
get the message.
what am i doing wrong? am i missing some other configuration?

thanks in advance,
fullWindsor

Ahmed Ali

unread,
Apr 9, 2009, 3:33:37 PM4/9/09
to log...@googlegroups.com
Hi fullWindsor,

From the below, I think you're confused. In log4erl:error/2,3,4, you
shouldn't put the appender name but the logger name. Appender's name
is used as a unique id used to identify the appender in gen_event
process and for informational messages (i.e.
log4erl:get_appenders/1,2).

If you're using the default logger, you don't need to supply any
logger name. If it didn't work, please send me "log4erl.conf" file and
I'll check it.

Regards,

Ahmed

fullWindsor

unread,
Apr 9, 2009, 5:15:38 PM4/9/09
to Log4erl
hi Ahmed, thank you for your quick response.

this is part of my log4erl.conf, the rest of the conf file is just the
default logger you supplied as an example:

logger loggername {
syslog_appender appendername {
level = error,
facility = local3,
format = '[%L] %I %l%n'
% host = localhost
% port = 514
}
}

and this is how i'm calling log4erl:

log4erl:error(loggername, "ERROR MESSAGE HERE").

i double checked all the config files (log4erl.conf, /etc/
syslog.conf, /etc/init.d/syslog) and can't see anything strange.

if something comes to your mind, please tell me.
regards,






On Apr 9, 4:33 pm, Ahmed Ali <ahmed.naw...@gmail.com> wrote:
> Hi fullWindsor,
>
> From the below, I think you're confused. In log4erl:error/2,3,4, you
> shouldn't put the appender name but the logger name. Appender's name
> is used as a unique id used to identify the appender in gen_event
> process and for informational messages (i.e.
> log4erl:get_appenders/1,2).
>
> If you're using the default logger, you don't need to supply any
> logger name. If it didn't work, please send me "log4erl.conf" file and
> I'll check it.
>
> Regards,
>
> Ahmed
>

Ahmed Ali

unread,
Apr 10, 2009, 8:04:00 AM4/10/09
to log...@googlegroups.com
Hi fullWindsor,

I see the issue now. I have to admit I'm not a syslog expert, so I
made this mistake. It's actually due to copy and paste from Torbjorn
Tornkvist's syslog module (can be found from erlang.org's contribution
section). It's fully my mistake not Torbjorn's fault :).

The problem here is that syslog_appender doesn't handle all facilities
as specified in syslog protocol, one of which is local* facilities.
Currently, syslog_appender handles the following facilities and
everything else is treated as 'user'.

kern
user
mail
daemon
auth
syslog
lpr
news
uucp
cron
authpriv
ftp

I'll fix this and release it within 2 days. I'm away from my main
machine and will do this over the weekend. For now, you can use one of
the facilities above. I'm sorry for the inconvenience.

Regards,

Ahmed

Ahmed Ali

unread,
Apr 12, 2009, 6:09:25 AM4/12/09
to log...@googlegroups.com
Hi fullWindsor,

As promised, attached is updated syslog_appender.erl file, which can
handle the added facilities below. Please add it to log4erl
distribution in "src", recompile and try again.

I've done a quick check and local0 can be received by ksyslogd in my
linux machine. Give it a try and then let me know.

audit
alert
clock
local0
local1
local2
local3
local4
local5
local6
local7

Regards,

Ahmed
syslog_appender.erl
Reply all
Reply to author
Forward
0 new messages