24 using Mono.Unix.Native;
26 namespace Ntp.Common.Log
31 : base(threshold, true)
36 private const SyslogFacility Facility = SyslogFacility.LOG_DAEMON;
37 private const SyslogOptions Options = SyslogOptions.LOG_PID;
40 private readonly
string name;
57 Syscall.openlog(UnixMarshal.StringToHeap(ident), Options, Facility);
73 WriteLine(exception,
Severity.Error);
78 WriteLine(exception.Message,
Severity.Error);
86 if (severity < Threshold)
89 Syscall.syslog(Facility, GetSyslogLevel(severity), text);
97 return SyslogLevel.LOG_ERR;
99 return SyslogLevel.LOG_WARNING;
101 return SyslogLevel.LOG_NOTICE;
103 return SyslogLevel.LOG_INFO;
106 return SyslogLevel.LOG_DEBUG;
108 return SyslogLevel.LOG_DEBUG;
override void Initialize()
override void WriteLine(string text, Severity severity)
override void WriteLine(Exception exception, Severity severity)
static SyslogLevel GetSyslogLevel(Severity severity)
override void WriteLine(Exception exception)
SysLog(string name, Severity threshold)