GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
No::Worries::Syslog(3) User Contributed Perl Documentation No::Worries::Syslog(3)

No::Worries::Syslog - syslog handling without worries

  use No::Worries::Syslog qw(syslog_open syslog_close syslog_info);

  # setup/open syslog
  syslog_open(ident => "progname", facility => "daemon");

  # report an informational message
  syslog_info("foo is %s", $foo);

  # close syslog
  syslog_close();

This module eases syslog handling by providing convenient wrappers around standard syslog functions.

The functions provide a thin layer on top of Sys::Syslog to make it easier and safer to use. All the functions die() on error and the strings passed to syslog will always be sanitized.

This module provides the following functions (none of them being exported by default):
syslog_open([OPTIONS])
open a "connection" to syslog using Sys::Syslog's openlog(); supported options
  • "facility": corresponding to openlog()'s eponymous argument
  • "ident": corresponding to openlog()'s eponymous argument
  • "option": corresponding to openlog()'s eponymous argument
syslog_close()
close a "connection" to syslog using Sys::Syslog's closelog()
syslog_sanitize(STRING)
sanitize the given string so that it can safely be given to syslog(): UTF-8 encode wide characters, trim trailing spaces, replace tabs by spaces, URI escape non-printable characters and truncate if too long
syslog_debug(MESSAGE)
report a sanitized debugging message to syslog (with LOG_DEBUG priority and "[DEBUG]" prefix)
syslog_debug(FORMAT, ARGUMENTS...)
idem but with sprintf()-like API
syslog_info(MESSAGE)
report a sanitized informational message to syslog (with LOG_INFO priority and "[INFO]" prefix)
syslog_info(FORMAT, ARGUMENTS...)
idem but with sprintf()-like API
syslog_warning(MESSAGE)
report a sanitized warning message to syslog (with LOG_WARNING priority and "[WARNING]" prefix)
syslog_warning(FORMAT, ARGUMENTS...)
idem but with sprintf()-like API
syslog_error(MESSAGE)
report a sanitized error message to syslog (with LOG_ERR priority and "[ERROR]" prefix)
syslog_error(FORMAT, ARGUMENTS...)
idem but with sprintf()-like API
log2syslog(INFO)
No::Worries::Log handler to send information to syslog; this is not exported and must be called explicitly

This module uses the following global variables (none of them being exported):
$MaximumLength
maximum length of a message given to syslog (default: 1000)
$SplitLines
true if multi-line messages should be logged as separate syslog messages (default: true)

No::Worries, No::Worries::Die, No::Worries::Log, No::Worries::Warn, Sys::Syslog, URI::Escape.

Lionel Cons <http://cern.ch/lionel.cons>

Copyright (C) CERN 2012-2019

2021-10-15 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.