1Net::Server::Log::Sys::USsyesrloCgo(n3t)ributed Perl DocNuemte:n:tSaetrivoenr::Log::Sys::Syslog(3)
2
3
4
6 Net::Server::Log::Sys::Syslog - log via Syslog
7
9 use base qw(Net::Server::PreFork);
10
11 __PACKAGE__->run(
12 log_file => 'Sys::Syslog',
13 syslog_ident => 'myapp',
14 );
15
17 This module provides Sys::Syslog logging to the Net::Server system.
18
20 log_file
21 To begin using Sys::Syslog logging, simply set the Net::Server
22 log_file configuration parameter to "Sys::Syslog".
23
24 If the magic name "Sys::Syslog" is used, all logging will take
25 place via the Sys::Syslog module. If syslog is used the parameters
26 "syslog_logsock", "syslog_ident", and "syslog_logopt",and
27 "syslog_facility" may also be defined.
28
29 syslog_logsock
30 Only available if "log_file" is equal to "Sys::Syslog". May be
31 either unix, inet, native, console, stream, udp, or tcp, or an
32 arrayref of the types to try. Default is "unix" if the version of
33 Sys::Syslog < 0.15 - otherwise the default is to not call
34 setlogsock.
35
36 See Sys::Syslog.
37
38 syslog_ident
39 Only available if "log_file" is equal to "Sys::Syslog". Id to
40 prepend on syslog entries. Default is "net_server". See
41 Sys::Syslog.
42
43 syslog_logopt
44 Only available if "log_file" is equal to "Sys::Syslog". May be
45 either zero or more of "pid","cons","ndelay","nowait". Default is
46 "pid". See Sys::Syslog.
47
48 syslog_facility
49 Only available if "log_file" is equal to "Sys::Syslog". See
50 Sys::Syslog and syslog. Default is "daemon".
51
53 The following arguments are available in the default "Net::Server" or
54 "Net::Server::Single" modules. (Other personalities may use additional
55 parameters and may optionally not use parameters from the base class.)
56
57 Key Value Default
58
59 ## syslog parameters (if log_file eq Sys::Syslog)
60 syslog_logsock (native|unix|inet|udp
61 |tcp|stream|console) unix (on Sys::Syslog < 0.15)
62 syslog_ident "identity" "net_server"
63 syslog_logopt (cons|ndelay|nowait|pid) pid
64 syslog_facility \w+ daemon
65
67 "initialize"
68 This method is called during the initilize_logging method of
69 Net::Server. It returns a single code ref that will be stored
70 under the log_function property of the Net::Server object. That
71 code ref takes log_level and message as arguments and calls the
72 initialized log4perl system.
73
74 "handle_log_error"
75 This method is called if the log_function fails for some reason.
76 It is passed the Net::Server object, the error that occurred while
77 logging and an arrayref containing the log level and the message.
78 In turn, this calls the legacy Net::Server::handle_syslog_error
79 method.
80
82 Distributed under the same terms as Net::Server
83
84
85
86perl v5.30.0 2017-08-10 Net::Server::Log::Sys::Syslog(3)