⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sys::syslog.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 2 页
字号:
(added in \f(CW\*(C`Sys::Syslog\*(C'\fR 0.21)..IP "\(bu" 4\&\f(CW"console"\fR \- send messages directly to the console, as for the \f(CW"cons"\fR option of \f(CW\*(C`openlog()\*(C'\fR..RE.RS 4.SpA reference to an array can also be passed as the first parameter.When this calling method is used, the array should contain a list ofmechanisms which are attempted in order..SpThe default is to try \f(CW\*(C`native\*(C'\fR, \f(CW\*(C`tcp\*(C'\fR, \f(CW\*(C`udp\*(C'\fR, \f(CW\*(C`unix\*(C'\fR, \f(CW\*(C`stream\*(C'\fR, \f(CW\*(C`console\*(C'\fR.Under systems with the Win32 \s-1API\s0, \f(CW\*(C`eventlog\*(C'\fR will be added as the first mechanism to try if \f(CW\*(C`Win32::EventLog\*(C'\fR is available..SpGiving an invalid value for \f(CW$sock_type\fR will \f(CW\*(C`croak\*(C'\fR..Sp\&\fBExamples\fR.SpSelect the \s-1UDP\s0 socket mechanism:.Sp.Vb 1\&    setlogsock("udp");.Ve.SpSelect the native, \s-1UDP\s0 socket then \s-1UNIX\s0 domain socket mechanisms:.Sp.Vb 1\&    setlogsock(["native", "udp", "unix"]);.Ve.IP "\fBNote\fR" 4.IX Item "Note"Now that the \*(L"native\*(R" mechanism is supported by \f(CW\*(C`Sys::Syslog\*(C'\fR and selected by default, the use of the \f(CW\*(C`setlogsock()\*(C'\fR function is discouraged because other mechanisms are less portable across operating systems.  Authors of modules and programs that use this function, especially its cargo-cult form \&\f(CW\*(C`setlogsock("unix")\*(C'\fR, are advised to remove any occurence of it unless they specifically want to use a given mechanism (like \s-1TCP\s0 or \s-1UDP\s0 to connect to a remote host)..RE.RS 4.RE.IP "\fB\f(BIcloselog()\fB\fR" 4.IX Item "closelog()"Closes the log file and returns true on success..SH "THE RULES OF SYS::SYSLOG".IX Header "THE RULES OF SYS::SYSLOG"\&\fIThe First Rule of Sys::Syslog is:\fRYou do not call \f(CW\*(C`setlogsock\*(C'\fR..PP\&\fIThe Second Rule of Sys::Syslog is:\fRYou \fBdo not\fR call \f(CW\*(C`setlogsock\*(C'\fR..PP\&\fIThe Third Rule of Sys::Syslog is:\fRThe program crashes, \f(CW\*(C`die\*(C'\fRs, calls \f(CW\*(C`closelog\*(C'\fR, the log is over..PP\&\fIThe Fourth Rule of Sys::Syslog is:\fROne facility, one priority..PP\&\fIThe Fifth Rule of Sys::Syslog is:\fROne log at a time..PP\&\fIThe Sixth Rule of Sys::Syslog is:\fRNo \f(CW\*(C`syslog\*(C'\fR before \f(CW\*(C`openlog\*(C'\fR..PP\&\fIThe Seventh Rule of Sys::Syslog is:\fRLogs will go on as long as they have to..PP\&\fIThe Eighth, and Final Rule of Sys::Syslog is:\fRIf this is your first use of Sys::Syslog, you must read the doc..SH "EXAMPLES".IX Header "EXAMPLES"An example:.PP.Vb 4\&    openlog($program, \*(Aqcons,pid\*(Aq, \*(Aquser\*(Aq);\&    syslog(\*(Aqinfo\*(Aq, \*(Aq%s\*(Aq, \*(Aqthis is another test\*(Aq);\&    syslog(\*(Aqmail|warning\*(Aq, \*(Aqthis is a better test: %d\*(Aq, time);\&    closelog();\&\&    syslog(\*(Aqdebug\*(Aq, \*(Aqthis is the last test\*(Aq);.Ve.PPAnother example:.PP.Vb 2\&    openlog("$program $$", \*(Aqndelay\*(Aq, \*(Aquser\*(Aq);\&    syslog(\*(Aqnotice\*(Aq, \*(Aqfooprogram: this is really done\*(Aq);.Ve.PPExample of use of \f(CW%m\fR:.PP.Vb 2\&    $! = 55;\&    syslog(\*(Aqinfo\*(Aq, \*(Aqproblem was %m\*(Aq);   # %m == $! in syslog(3).Ve.PPLog to \s-1UDP\s0 port on \f(CW$remotehost\fR instead of logging locally:.PP.Vb 4\&    setlogsock(\*(Aqudp\*(Aq);\&    $Sys::Syslog::host = $remotehost;\&    openlog($program, \*(Aqndelay\*(Aq, \*(Aquser\*(Aq);\&    syslog(\*(Aqinfo\*(Aq, \*(Aqsomething happened over here\*(Aq);.Ve.SH "CONSTANTS".IX Header "CONSTANTS".Sh "Facilities".IX Subsection "Facilities".IP "\(bu" 4\&\f(CW\*(C`LOG_AUDIT\*(C'\fR \- audit daemon (\s-1IRIX\s0); falls back to \f(CW\*(C`LOG_AUTH\*(C'\fR.IP "\(bu" 4\&\f(CW\*(C`LOG_AUTH\*(C'\fR \- security/authorization messages.IP "\(bu" 4\&\f(CW\*(C`LOG_AUTHPRIV\*(C'\fR \- security/authorization messages (private).IP "\(bu" 4\&\f(CW\*(C`LOG_CONSOLE\*(C'\fR \- \f(CW\*(C`/dev/console\*(C'\fR output (FreeBSD); falls back to \f(CW\*(C`LOG_USER\*(C'\fR.IP "\(bu" 4\&\f(CW\*(C`LOG_CRON\*(C'\fR \- clock daemons (\fBcron\fR and \fBat\fR).IP "\(bu" 4\&\f(CW\*(C`LOG_DAEMON\*(C'\fR \- system daemons without separate facility value.IP "\(bu" 4\&\f(CW\*(C`LOG_FTP\*(C'\fR \- \s-1FTP\s0 daemon.IP "\(bu" 4\&\f(CW\*(C`LOG_KERN\*(C'\fR \- kernel messages.IP "\(bu" 4\&\f(CW\*(C`LOG_INSTALL\*(C'\fR \- installer subsystem (Mac \s-1OS\s0 X); falls back to \f(CW\*(C`LOG_USER\*(C'\fR.IP "\(bu" 4\&\f(CW\*(C`LOG_LAUNCHD\*(C'\fR \- launchd \- general bootstrap daemon (Mac \s-1OS\s0 X);falls back to \f(CW\*(C`LOG_DAEMON\*(C'\fR.IP "\(bu" 4\&\f(CW\*(C`LOG_LFMT\*(C'\fR \- logalert facility; falls back to \f(CW\*(C`LOG_USER\*(C'\fR.IP "\(bu" 4\&\f(CW\*(C`LOG_LOCAL0\*(C'\fR through \f(CW\*(C`LOG_LOCAL7\*(C'\fR \- reserved for local use.IP "\(bu" 4\&\f(CW\*(C`LOG_LPR\*(C'\fR \- line printer subsystem.IP "\(bu" 4\&\f(CW\*(C`LOG_MAIL\*(C'\fR \- mail subsystem.IP "\(bu" 4\&\f(CW\*(C`LOG_NETINFO\*(C'\fR \- NetInfo subsystem (Mac \s-1OS\s0 X); falls back to \f(CW\*(C`LOG_DAEMON\*(C'\fR.IP "\(bu" 4\&\f(CW\*(C`LOG_NEWS\*(C'\fR \- \s-1USENET\s0 news subsystem.IP "\(bu" 4\&\f(CW\*(C`LOG_NTP\*(C'\fR \- \s-1NTP\s0 subsystem (FreeBSD, NetBSD); falls back to \f(CW\*(C`LOG_DAEMON\*(C'\fR.IP "\(bu" 4\&\f(CW\*(C`LOG_RAS\*(C'\fR \- Remote Access Service (\s-1VPN\s0 / \s-1PPP\s0) (Mac \s-1OS\s0 X);falls back to \f(CW\*(C`LOG_AUTH\*(C'\fR.IP "\(bu" 4\&\f(CW\*(C`LOG_REMOTEAUTH\*(C'\fR \- remote authentication/authorization (Mac \s-1OS\s0 X);falls back to \f(CW\*(C`LOG_AUTH\*(C'\fR.IP "\(bu" 4\&\f(CW\*(C`LOG_SECURITY\*(C'\fR \- security subsystems (firewalling, etc.) (FreeBSD);falls back to \f(CW\*(C`LOG_AUTH\*(C'\fR.IP "\(bu" 4\&\f(CW\*(C`LOG_SYSLOG\*(C'\fR \- messages generated internally by \fBsyslogd\fR.IP "\(bu" 4\&\f(CW\*(C`LOG_USER\*(C'\fR (default) \- generic user-level messages.IP "\(bu" 4\&\f(CW\*(C`LOG_UUCP\*(C'\fR \- \s-1UUCP\s0 subsystem.Sh "Levels".IX Subsection "Levels".IP "\(bu" 4\&\f(CW\*(C`LOG_EMERG\*(C'\fR \- system is unusable.IP "\(bu" 4\&\f(CW\*(C`LOG_ALERT\*(C'\fR \- action must be taken immediately.IP "\(bu" 4\&\f(CW\*(C`LOG_CRIT\*(C'\fR \- critical conditions.IP "\(bu" 4\&\f(CW\*(C`LOG_ERR\*(C'\fR \- error conditions.IP "\(bu" 4\&\f(CW\*(C`LOG_WARNING\*(C'\fR \- warning conditions.IP "\(bu" 4\&\f(CW\*(C`LOG_NOTICE\*(C'\fR \- normal, but significant, condition.IP "\(bu" 4\&\f(CW\*(C`LOG_INFO\*(C'\fR \- informational message.IP "\(bu" 4\&\f(CW\*(C`LOG_DEBUG\*(C'\fR \- debug-level message.SH "DIAGNOSTICS".IX Header "DIAGNOSTICS".ie n .IP """Invalid argument passed to setlogsock""" 4.el .IP "\f(CWInvalid argument passed to setlogsock\fR" 4.IX Item "Invalid argument passed to setlogsock"\&\fB(F)\fR You gave \f(CW\*(C`setlogsock()\*(C'\fR an invalid value for \f(CW$sock_type\fR..ie n .IP """eventlog passed to setlogsock, but no Win32 API available""" 4.el .IP "\f(CWeventlog passed to setlogsock, but no Win32 API available\fR" 4.IX Item "eventlog passed to setlogsock, but no Win32 API available"\&\fB(W)\fR You asked \f(CW\*(C`setlogsock()\*(C'\fR to use the Win32 event logger but the operating system running the program isn't Win32 or does not provides Win32compatible facilities..ie n .IP """no connection to syslog available""" 4.el .IP "\f(CWno connection to syslog available\fR" 4.IX Item "no connection to syslog available"\&\fB(F)\fR \f(CW\*(C`syslog()\*(C'\fR failed to connect to the specified socket..ie n .IP """stream passed to setlogsock, but %s is not writable""" 4.el .IP "\f(CWstream passed to setlogsock, but %s is not writable\fR" 4.IX Item "stream passed to setlogsock, but %s is not writable"\&\fB(W)\fR You asked \f(CW\*(C`setlogsock()\*(C'\fR to use a stream socket, but the given path is not writable..ie n .IP """stream passed to setlogsock, but could not find any device""" 4.el .IP "\f(CWstream passed to setlogsock, but could not find any device\fR" 4.IX Item "stream passed to setlogsock, but could not find any device"\&\fB(W)\fR You asked \f(CW\*(C`setlogsock()\*(C'\fR to use a stream socket, but didn't provide a path, and \f(CW\*(C`Sys::Syslog\*(C'\fR was unable to find an appropriate one..ie n .IP """tcp passed to setlogsock, but tcp service unavailable""" 4.el .IP "\f(CWtcp passed to setlogsock, but tcp service unavailable\fR" 4.IX Item "tcp passed to setlogsock, but tcp service unavailable"\&\fB(W)\fR You asked \f(CW\*(C`setlogsock()\*(C'\fR to use a \s-1TCP\s0 socket, but the service is not available on the system..ie n .IP """syslog: expecting argument %s""" 4.el .IP "\f(CWsyslog: expecting argument %s\fR" 4.IX Item "syslog: expecting argument %s"\&\fB(F)\fR You forgot to give \f(CW\*(C`syslog()\*(C'\fR the indicated argument..ie n .IP """syslog: invalid level/facility: %s""" 4.el .IP "\f(CWsyslog: invalid level/facility: %s\fR" 4.IX Item "syslog: invalid level/facility: %s"\&\fB(F)\fR You specified an invalid level or facility..ie n .IP """syslog: too many levels given: %s""" 4.el .IP "\f(CWsyslog: too many levels given: %s\fR" 4.IX Item "syslog: too many levels given: %s"\&\fB(F)\fR You specified too many levels..ie n .IP """syslog: too many facilities given: %s""" 4.el .IP "\f(CWsyslog: too many facilities given: %s\fR" 4.IX Item "syslog: too many facilities given: %s"\&\fB(F)\fR You specified too many facilities..ie n .IP """syslog: level must be given""" 4.el .IP "\f(CWsyslog: level must be given\fR" 4.IX Item "syslog: level must be given"\&\fB(F)\fR You forgot to specify a level..ie n .IP """udp passed to setlogsock, but udp service unavailable""" 4.el .IP "\f(CWudp passed to setlogsock, but udp service unavailable\fR" 4.IX Item "udp passed to setlogsock, but udp service unavailable"\&\fB(W)\fR You asked \f(CW\*(C`setlogsock()\*(C'\fR to use a \s-1UDP\s0 socket, but the service is not available on the system..ie n .IP """unix passed to setlogsock, but path not available""" 4.el .IP "\f(CWunix passed to setlogsock, but path not available\fR" 4.IX Item "unix passed to setlogsock, but path not available"\&\fB(W)\fR You asked \f(CW\*(C`setlogsock()\*(C'\fR to use a \s-1UNIX\s0 socket, but \f(CW\*(C`Sys::Syslog\*(C'\fR was unable to find an appropriate an appropriate device..SH "SEE ALSO".IX Header "SEE ALSO".Sh "Manual Pages".IX Subsection "Manual Pages"\&\fIsyslog\fR\|(3).PPSUSv3 issue 6, \s-1IEEE\s0 Std 1003.1, 2004 edition, <http://www.opengroup.org/onlinepubs/000095399/basedefs/syslog.h.html>.PP\&\s-1GNU\s0 C Library documentation on syslog, <http://www.gnu.org/software/libc/manual/html_node/Syslog.html>.PPSolaris 10 documentation on syslog, <http://docs.sun.com/app/docs/doc/816\-5168/6mbb3hruo?a=view>.PP\&\s-1IRIX\s0 6.4 documentation on syslog,<http://techpubs.sgi.com/library/tpl/cgi\-bin/getdoc.cgi?coll=0640&db=man&fname=3c+syslog>.PP\&\s-1AIX\s0 5L 5.3 documentation on syslog, <http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf2/syslog.htm>.PPHP-UX 11i documentation on syslog, <http://docs.hp.com/en/B9106\-90010/syslog.3C.html>.PPTru64 5.1 documentation on syslog, <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51_HTML/MAN/MAN3/0193_\|_\|_\|_.HTM>.PPStratus \s-1VOS\s0 15.1, <http://stratadoc.stratus.com/vos/15.1.1/r502\-01/wwhelp/wwhimpl/js/html/wwhelp.htm?context=r502\-01&file=ch5r502\-01bi.html>.Sh "RFCs".IX Subsection "RFCs"\&\fI\s-1RFC\s0 3164 \- The \s-1BSD\s0 syslog Protocol\fR, <http://www.faqs.org/rfcs/rfc3164.html>\&\*(-- Please note that this is an informational \s-1RFC\s0, and therefore does not specify a standard of any kind..PP\&\fI\s-1RFC\s0 3195 \- Reliable Delivery for syslog\fR, <http://www.faqs.org/rfcs/rfc3195.html>.Sh "Articles".IX Subsection "Articles"\&\fISyslogging with Perl\fR, <http://lexington.pm.org/meetings/022001.html>.Sh "Event Log".IX Subsection "Event Log"Windows Event Log,<http://msdn.microsoft.com/library/default.asp?url=/library/en\-us/wes/wes/windows_event_log.asp>.SH "AUTHORS & ACKNOWLEDGEMENTS".IX Header "AUTHORS & ACKNOWLEDGEMENTS"Tom Christiansen <\fItchrist (at) perl.com\fR> and Larry Wall<\fIlarry (at) wall.org\fR>..PP\&\s-1UNIX\s0 domain sockets added by Sean Robinson<\fIrobinson_s (at) sc.maricopa.edu\fR> with support from Tim Bunce <\fITim.Bunce (at) ig.co.uk\fR> and the \f(CW\*(C`perl5\-porters\*(C'\fR mailing list..PPDependency on \fIsyslog.ph\fR replaced with \s-1XS\s0 code by Tom Hughes<\fItom (at) compton.nu\fR>..PPCode for \f(CW\*(C`constant()\*(C'\fRs regenerated by Nicholas Clark <\fInick (at) ccl4.org\fR>..PPFailover to different communication modes by Nick Williams<\fINick.Williams (at) morganstanley.com\fR>..PPExtracted from core distribution for publishing on the \s-1CPAN\s0 by Se\*'bastien Aperghis-Tramoni <sebastien (at) aperghis.net>..PP\&\s-1XS\s0 code for using native C functions borrowed from \f(CW\*(C`Unix::Syslog\*(C'\fR, written by Marcus Harnisch <\fImarcus.harnisch (at) gmx.net\fR>..PPYves Orton suggested and helped for making \f(CW\*(C`Sys::Syslog\*(C'\fR use the native event logger under Win32 systems..PPJerry D. Hedden and Reini Urban provided greatly appreciated help to debug and polish \f(CW\*(C`Sys::Syslog\*(C'\fR under Cygwin..SH "BUGS".IX Header "BUGS"Please report any bugs or feature requests to\&\f(CW\*(C`bug\-sys\-syslog (at) rt.cpan.org\*(C'\fR, or through the web interface at<http://rt.cpan.org/Public/Dist/Display.html?Name=Sys\-Syslog>.I will be notified, and then you'll automatically be notified of progress onyour bug as I make changes..SH "SUPPORT".IX Header "SUPPORT"You can find documentation for this module with the perldoc command..PP.Vb 1\&    perldoc Sys::Syslog.Ve.PPYou can also look for information at:.IP "\(bu" 4AnnoCPAN: Annotated \s-1CPAN\s0 documentation.Sp<http://annocpan.org/dist/Sys\-Syslog>.IP "\(bu" 4\&\s-1CPAN\s0 Ratings.Sp<http://cpanratings.perl.org/d/Sys\-Syslog>.IP "\(bu" 4\&\s-1RT:\s0 \s-1CPAN\s0's request tracker.Sp<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Sys\-Syslog>.IP "\(bu" 4Search \s-1CPAN\s0.Sp<http://search.cpan.org/dist/Sys\-Syslog/>.IP "\(bu" 4Kobes' \s-1CPAN\s0 Search.Sp<http://cpan.uwinnipeg.ca/dist/Sys\-Syslog>.IP "\(bu" 4Perl Documentation.Sp<http://perldoc.perl.org/Sys/Syslog.html>.SH "COPYRIGHT".IX Header "COPYRIGHT"Copyright (C) 1990\-2007 by Larry Wall and others..SH "LICENSE".IX Header "LICENSE"This program is free software; you can redistribute it and/or modify itunder the same terms as Perl itself.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -