Log::An...::Syslog(3)

πŸ’– Log::Any::Adapter::Syslog β€” the manual, but make it cute ✨

okay so bestie, this is Log::An...::Syslog(3) from the User Contributed Perl Documentation collection, and it's literally the page that tells you how to yeet your Log::Any logs straight into syslog. no cap. let's get into it 🫢


🌸 NAME 🌸

Log::Any::Adapter::Syslog β€” send Log::Any logs to syslog πŸ’Œ


πŸŽ€ VERSION πŸŽ€

version 1.718


✨ SYNOPSIS ✨

use Log::Any::Adapter 'Syslog';
# ... or ...
use Log::Any::Adapter;
Log::Any::Adapter->set('Syslog');

# You can override defaults:
Log::Any::Adapter->set(
    'Syslog',
    # name defaults to basename($0)
    name     => 'my-name',
    # options default to "pid"
    options  => "pid,ndelay",
    # facility defaults to "local7"
    facility => "mail"
);

like, two whole ways to set it up and then a glow-up version where you customize everything πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Log::Any is a generic adapter for writing logging into Perl modules; this adapter uses the Sys::Syslog module to direct that output into the OS's logging system β€” even on Windows. yes bestie, even there. iconic of it honestly.


🌈 CONFIGURATION 🌈

Log::Any::Adapter::Syslog is designed to work out of the box with no configuration required; the defaults should be reasonably sensible. she's low-maintenance like that 😌

You can override the default configuration by passing extra arguments to the Log::Any::Adapter method:

  • name β€” The name argument defaults to the basename of $0 if not supplied, and is inserted into each line sent to syslog to identify the source. it's the lil name tag so syslog knows who's talking 🏷️
  • options β€” The options configure the behaviour of syslog; see Sys::Syslog for details.

The default is "pid", which includes the PID of the current process after the process name:

example-process[2345]: something amazing!

The most likely addition to that is "perror" (non-POSIX) which causes syslog to also send a copy of all log messages to the controlling terminal of the process.

  • facility β€” The facility determines where syslog sends your messages. The default is "local7", which is not the most useful value ever, but is less bad than assuming the fixed facilities. bestie she's self-aware about it 😭

See Sys::Syslog and syslog(3) for details on the available facilities.

  • log_level β€” Minimum log level. All messages below the selected level will be silently discarded. Default is debug.

If LOG_LEVEL environment variable is set, it will be used instead. If TRACE environment variable is set to true, level will be set to 'trace'. If DEBUG environment variable is set to true, level will be set to 'debug'. If VERBOSE environment variable is set to true, level will be set to 'info'. If QUIET environment variable is set to true, level will be set to 'error'.

ngl the env vars take priority over whatever you pass in, so if your logs are acting weird, vibe check your environment first πŸ”

πŸ‘‘ AUTHORS πŸ‘‘

the literal main characters who made this happen πŸ’œ

  • Jonathan Swartz <swartz@pobox.com>
  • David Golden <dagolden@cpan.org>
  • Doug Bell <preaction@cpan.org>
  • Daniel Pittman <daniel@rimspace.net>
  • Stephen Thirlwall <sdt@cpan.org>

This software is copyright (c) 2017 by Jonathan Swartz, David Golden, and Doug Bell.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


and that's the whole page, periodt πŸ’… this edition ships as perl v5.42.0, dated 2025-07-28 β€” go forth and log slayfully, bestie πŸ§šπŸ’–

πŸ“¦ where this page comes from