eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'UnixSyslogInterface':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: UnixSyslogInterface


Inheritance:

   Object
   |
   +--MiniLogger
      |
      +--UnixSyslogInterface

Package:
stx:libbasic
Category:
System-Debugging-Support
Version:
rev: 1.12 date: 2023/09/14 10:50:42
user: stefan
file: UnixSyslogInterface.st directory: libbasic
module: stx stc-classLibrary: libbasic

Description:


This logger logs messages via the Unix/Linux syslog system call
(so it is not available in Windows).
It uses any log method implemented in the syslog system call, e.g.
logging via network.


[class variables:]
    DefaultSyslogFacility   Integer     the default facility of syslog (e.g. self LOG_LOCAL0).
                                        This is different from the Logger facility arg.

copyright

COPYRIGHT (c) 2018 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

accessing
o  defaultSyslogFacility

o  defaultSyslogFacility: anInteger
set the default facility of syslog (e.g. self LOG_LOCAL0).
This is different from the Logger facility arg.

accessing-facilities
o  LOG_AUTH

o  LOG_AUTHPRIV

o  LOG_CRON

o  LOG_DAEMON

o  LOG_FTP

o  LOG_KERN

o  LOG_LOCAL0

o  LOG_LOCAL1

o  LOG_LOCAL2

o  LOG_LOCAL3

o  LOG_LOCAL4

o  LOG_LOCAL5

o  LOG_LOCAL6

o  LOG_LOCAL7

o  LOG_LPR

o  LOG_MAIL

o  LOG_NEWS

o  LOG_SYSLOG

o  LOG_USER

o  LOG_UUCP

accessing-options
o  LOG_CONS

o  LOG_NDELAY

o  LOG_ODELAY

o  LOG_PERROR

o  LOG_PID

accessing-priorities
o  LOG_ALERT

o  LOG_CRIT

o  LOG_DEBUG

o  LOG_EMERG

o  LOG_ERR

o  LOG_INFO

o  LOG_NOTICE

o  LOG_WARNING

api
o  apiSyslog: priority format: format message: message
self openlog:'stx2' option:0 facility:self LOG_LOCAL7.
self apiSyslog:self LOG_WARNING format:'%s' message:'stx %% demo'.
self closelog.

o  closelog

o  libraryName

o  openlog: ident option: option facility: facility
self new openlog:'stx' option:0 facility:0.
self new closelog.

initialization
o  initialize
Priorities: map Logger priorities to syslog priorities

logging
o  syslog: priority message: message arguments: argArray
self openlog:'stx' option:0 facility:self LOG_USER.
self syslog:self LOG_WARNING message:'%1 demo (%2%)' arguments:#('stx' 16).
self closelog.

private
o  basicLog: message severity: severity facility: facility originator: originator attachment: attachment
with:'' "/ severity name

queries
o  canLog
(comment from inherited method)
answer true, if logging is to be performed.
Subclasse may redefine this.


Examples:


    Logger := self.
    self info:'%1 info demo » (%2%)' with:'stx' with:16.
    self warning:'%1 warning demo (%2%)' with:'stx' with:16.
    self error:'%1 error demo (%2%)' with:'stx' with:16.
    self fatal:'%1 fatal demo (%2%)' with:'stx' with:16.
    Logger := MiniLogger.
    self openlog:'stx' option:0 facility:self LOG_USER.
    self syslog:self LOG_WARNING message:'%1 demo (%2%)' arguments:#('stx' 16).
    self closelog.


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 07 Sep 2024 23:30:23 GMT