log4cl

API Reference

log4cl

LOG4CL-IMPL-FIXER

No exported symbols.

LOG4CL-IMPL

  • Variable +LOG-LEVEL-UNSET+
    16
  • Variable +LOG-LEVEL-DEBU9+
    15
  • Variable +LOG-LEVEL-DEBU8+
    14
  • Variable +LOG-LEVEL-DEBU7+
    13
  • Variable +LOG-LEVEL-DEBU6+
    12
  • Variable +LOG-LEVEL-DEBU5+
    11
  • Variable +LOG-LEVEL-TRACE+
    10
  • Variable +LOG-LEVEL-DEBU4+
    9
  • Variable +LOG-LEVEL-DEBU3+
    8
  • Variable +LOG-LEVEL-DEBU2+
    7
  • Variable +LOG-LEVEL-DEBU1+
    6
  • Variable +LOG-LEVEL-DEBUG+
    5
  • Variable +LOG-LEVEL-INFO+
    4
  • Variable +LOG-LEVEL-WARN+
    3
  • Variable +LOG-LEVEL-ERROR+
    2
  • Variable +LOG-LEVEL-FATAL+
    1
  • Variable +LOG-LEVEL-OFF+
    0
  • Variable +MIN-LOG-LEVEL+
    log4cl-impl:+log-level-fatal+
  • Variable +MAX-LOG-LEVEL+
    log4cl-impl:+log-level-debu9+
  • Variable *LOG-INDENT*
    0
    Indent level can be used to indent logging info, is printed by %I pattern format
  • Variable *NDC-CONTEXT*
  • Variable *LOGGER-TRUENAME*
    nil
    Will be used instead of *COMPILE-FILE-TRUENAME* or *LOAD-TRUENAME* when non-NIL to determine logger's parent file logger.
  • Condition LOG4CL-ERROR  (SIMPLE-ERROR, PROGRAM-ERROR)
    Base class for all LOG4CL errors
  • Function LOG4CL-ERROR (message &rest args)
  • Variable +EXPR-FORMAT-SIMPLE+
    "~w: ~w ~:_"
  • Variable +EXPR-FORMAT-FANCY+
    "~:_~<~(~w~): ~2i~_~w~:> "
  • Class NAMING-CONFIGURATION
    Contains configuration that affects expansion of logger macros.
    CATEGORY-SEPARATOR   Accessor: %CATEGORY-SEPARATOR
    CATEGORY-CASE   Accessor: %CATEGORY-CASE
    EXPR-PRINT-FORMAT   Accessor: %EXPR-PRINT-FORMAT
    USE-SHORTEST-NICKNAME   Accessor: %USE-SHORTEST-NICKNAME
    EXPR-LOG-LEVEL   Accessor: %EXPR-LOG-LEVEL
    OLD-LOGGING-MACROS   Accessor: %OLD-LOGGING-MACROS
  • Variable *NAMING-CONFIGURATION*
    nil
    Naming configuration currently in effect
  • Function CATEGORY-SEPARATOR (&optional (nc *naming-configuration*))
  • Function CATEGORY-CASE (&optional (nc *naming-configuration*))
  • Function EXPR-PRINT-FORMAT (&optional (nc *naming-configuration*))
  • Function OLD-LOGGING-MACROS (&optional (nc *naming-configuration*))
  • Variable *DEFAULT-NAMING-CONFIGURATION*
    (make-instance 'log4cl-impl:naming-configuration :use-shortest-nickname t)
    Default naming configuration
  • Macro WITH-PACKAGE-NAMING-CONFIGURATION ((package) &body body)
  • Generic-Function LOG-LEVEL-FROM-OBJECT (obj package)
    Should return numeric log level from the user representation, can be specialized per-package to have custom log level names. Default implementation converts object to string and parses "fatal" "debug" and so on. Called by MAKE-LOG-LEVEL function
  • Generic-Function NAMING-OPTION (package option)
    DEPRECIATED. Use PACKAGE-OPTIONS macro instead
  • Generic-Function PACKAGE-WRAPPER (package categories explicit-p)
    DEPRECIATED. Allows packages to optionally massage logger names in their namespace. CATEGORIES will be a list of category names from parent to child, and EXPLICIT-P will be non-NIL if that list was specified as an explicit list constant in a logging macro. Should return (values NEW-CATEGORIES [CAT-LIST-INDEXES]) Where NEW-CATEGORIES should be a new list of categories to use instead of CATEGORIES. CAT-LIST-INDEXES should be a list of three numbers (FILE-IDX PACKAGE-START-IDX PACKAGE-END-IDX) which have the following meaning: * FILE-IDX -- index of the category representing file name (zero based) * PACKAGE-IDX -- index of the first and last (exclusive) category representing the package. Based on the above indexes, the pattern layout %g (package) and %F (file name) and %G (everything else) will be able to return correct values, on matter where in the package or filename are located in the category hierarchy. Default method will first find PACKAGE shortest nickname, then split it according to category-separator naming option, then return the values like so: (,@<split package> ,*LOGGER-TRUENAME* ,@CATEGORIES)
  • Generic-Function RESOLVE-LOGGER-FORM (package env args)
    Is called by all logging macros to figure out the logger to log into. PACKAGE and ENV are the current value of *PACKAGE* and the macro environment of the logging macro, and ARGS are its arguments. Returns two values, first being either a logger, or a form that when evaluated will return a logger, and second value being list of arguments to be passed to the format statement that will log the message. When second value returned is NIL, then logging macro will not log any message but will rather expand into a non-NIL value if logging is enabled on that logger.
  • Generic-Function ENCLOSING-SCOPE-BLOCK-NAME (package env)
    Is called by RESOLVE-DEFAULT-LOGGER-FORM to try to determine the enclosing lexical scope name. For example if logging macro is being expanded while compiling local function BAR inside of a definition of function FOO, the implementation of this method should strive to return '(FOO BAR) if possible. For CLOS method it is recommended that return value be a generic function name, followed by optional qualifier, and then followed by any non-T specializers, with EQL specializers flattened to their values, for example for the :AROUND method FOO with lambda list of ((OBJ1 BAR) (OPTION (EQL :BAZ)) OBJ3) should strive to return '(FOO AROUND BAR BAZ)
  • Method LOG-LEVEL-FROM-OBJECT (arg package)
    Converts human readable log level description in ARG into numeric log level. Supported values for ARG are: - Symbol or string which name matches log level, e.g: :debug, :info, DEBUG, USER1, :err "off" - 1-character long symbol or string, used as a shortcut. All standard levels can be uniquely identified by their first character: (o)ff (f)atal (e)rror (w)arn (i)nfo (d)ebug (t)race (u)nset, - 1 character digit 1 through 9 identifying user1 through user9 levels.
  • Function MAKE-PACKAGE-CATEGORIES (package)
    Return package categories split as per package configuration
  • Method PACKAGE-WRAPPER (package categories explicit-p)
    Find the PACKAGES shortest name or nickname, and prefix CATEGORIES list with it
  • Function JOIN-CATEGORIES (separator list)
    Return a string with each element of LIST printed separated by SEPARATOR
  • Method NAMING-OPTION (package option)
    Return default values for naming options which are: :CATEGORY-SEPARATOR ":"
  • Method RESOLVE-LOGGER-FORM (package env args)
    - When first element of args is NIL or a constant string, calls RESOLVE-DEFAULT-LOGGER-FORM that will try to obtain logger name from the environment - When first argument is a :KEYWORD, returns logger named <KEYWORD> - When first argument is a quoted symbol, returns logger named <current-package>.<symbol> - Otherwise returns the form `(GET-LOGGER ,(FIRST ARGS) ,@(REST ARGS))'
  • Function FIX-METHOD-SPEC-LIST (spec)
    Flatten method specializer list, remove any T specializers, replace all constant EQL specializers with their values, and eliminate non-constant ones
  • Method ENCLOSING-SCOPE-BLOCK-NAME (package env)
    Return the enclosing block name suitable for naming a logger
  • Class APPENDER
    Appender is log message sink, and is responsible for physically delivering the log message, somewhere. The formatting of message is done by layout. Appenders can be called from multiple threads and are responsible for serializing access to any resources. Appender will not be appended into if ENABLED slot is NIL HANDLE-APPENDER-ERROR generic function is called if condition is signaled from APPENDER-DO-APPEND method. See description of that function for the protocol.
    LAYOUT   Accessor: APPENDER-LAYOUT
    LOGGER-COUNT   Accessor: APPENDER-LOGGER-COUNT
    LOGGERS   Accessor: APPENDER-LOGGERS
    ENABLED   Accessor: APPENDER-ENABLED-P
    FILTER   Accessor: APPENDER-FILTER
    LAST-ERROR   Accessor: APPENDER-LAST-ERROR
    LAST-IGNORED-ERROR   Accessor: APPENDER-LAST-IGNORED-ERROR
    ERROR-COUNT   Accessor: APPENDER-ERROR-COUNT
    IGNORED-ERROR-COUNT   Accessor: APPENDER-IGNORED-ERROR-COUNT
    MESSAGE-COUNT   Accessor: APPENDER-MESSAGE-COUNT
  • Generic-Function APPENDER-ADDED (logger appender)
    Called when appender is added to a logger. Default method is used to keep logger count, and if re-implemented the (CALL-NEXT-METHOD) needs to be called.
  • Generic-Function APPENDER-REMOVED (logger appender)
    Called when appender is removed from a logger Default method is used to keep logger refcount, and calls CLOSE-APPENDER when it reaches zero. If re-implemented the (CALL-NEXT-METHOD) needs to be called
  • Generic-Function CLOSE-APPENDER (appender)
    Called when appender refcount reaches zero after being positive. Should close any streams or files that appender had opened.
  • Generic-Function SAVE-APPENDER (appender)
    Called from SAVE-HOOKS, must close appenders that own their stream in a such way, so its possible to reopen them
  • Generic-Function APPENDER-DO-APPEND (appender logger level log-func)
    Writes the log message into the appender. Text of the log message is specified indirectly via LOG-FUNC argument, which will be a function that accepts a stream, and writes the text of log message to it. This function should first figure out or obtain the stream to write the log message to, and then call the LAYOUT-TO-STREAM function to have layout do actual formatting. If appender destination is ultimately not a stream, then it can obtain the full text of the log message by calling LAYOUT-TO-STREAM inside of WITH-OUTPUT-TO-STRING Example: (defmethod appender-do-append ((self custom-appender) logger level log-func) (let ((stream (custom-appender-destination))) (layout-to-stream (slot-value self 'layout) stream logger level log-func)) (values)) Return value of this function is ignored
  • Method APPENDER-DO-APPEND ((appender appender) logger level log-func)
  • Method APPENDER-DO-APPEND ((appender appender) logger level log-func)
  • Method APPENDER-DO-APPEND ((appender appender) logger level log-func)
  • Generic-Function HANDLE-APPENDER-ERROR (appender condition)
    Called when a condition is raised doing writing to the appender by APPENDER-DO-APPEND call, must return a keyword indicating action to take. :DISABLE -- Appender is permanently disabled by setting ENABLED slot to NIL, any farther appends will be ignored. :RETRY -- immediately retry logging the same log message. To prevent forever loops, only up to three retries will be performed, and if error persists on the third try, appender will be disabled :IGNORE -- Do nothing. Log message will be lost, but appender will be used again if more log messages come in. Any other values are treated as :DISABLE After calling this function, LOG4CL will update the RETRY-COUNT, IGNORE-COUNT, LAST-ERROR and LAST-IGNORED-ERROR slots of the appender, based on the return value. Default primary method logs the error, and returns :DISABLE
  • Generic-Function APPENDER-DO-FLUSH (appender time)
    Perform any flushes of appender output if needed, marking the that output was performed at time TIME. This function can be called from any thread and should take care of serializing
  • Method APPENDER-DO-FLUSH (appender time)
  • Method APPENDER-DO-FLUSH (appender time)
  • Method APPENDER-DO-FLUSH (appender time)
  • Variable *HIERARCHY*
    0
    Active hierarchy index. All logging functions use logger state indexed by this variable. Can be assigned directly or
  • Generic-Function WATCH-TOKEN-CHECK (token)
    Will be called on each member of WATCH-TOKENS list when hierarchy watcher thread is started. If a unhandled condition is signaled from this function the watcher thread will remove corresponding token from the list
  • Function HIERARCHY-INDEX (hierarchy)
    Return the hierarchy index for the specified hierarchy. Hierarchy must be already a number or a unique identifier suitable for comparing using EQL. If hierarchy is a string, it will be interned in the current package
  • Function ADD-WATCH-TOKEN (token &key (test #'equal) key (hierarchy (current-hierarchy)))
    Add unique watch token to the HIERARCHY, uniqueness is determined by TEST and KEY arguments which are passed to FIND and REMOVE. Any matching token is already present, the old token is removed and new one is inserted. The per-hierarchy lock is held doing the operation. Automatically starts hierarchy watcher thread, if it was not already started
  • Function REMOVE-WATCH-TOKEN (token &key (test #'equal) key (hierarchy (current-hierarchy)))
    Removes the watch token from the hierarchy, that matches the specified KEY and TEST arguments, which are passed to REMOVE function. Holds per-hierarchy lock doing its operation
  • Function LOGGER-CATEGORY (logger)
  • Function LOGGER-PARENT (logger)
  • Function LOGGER-DEPTH (logger)
  • Function LOG-LEVEL-TO-STRING (level)
    Return log-level string for the level
  • Function MAKE-LOG-LEVEL (arg)
    Translate a more human readable log level into one of the log level constants, by calling LOG-LEVEL-FROM-OBJECT on ARG and current value of *PACKAGE*
  • Function EFFECTIVE-LOG-LEVEL (logger)
    Return logger's own log level (if set) or the one it had inherited from parent
  • Function INHERITED-LOG-LEVEL (logger)
    Return logger's own log level (if set) or the one it had inherited from parent
  • Function MAP-LOGGER-CHILDREN (function logger)
    Apply the function to all of logger's children (but not their descendants)
  • Function MAP-LOGGER-DESCENDANTS (function logger)
    Apply the function to all of logger's descendants
  • Function %GET-LOGGER (categories cat-sep cat-case &optional force-string-case (createp t) file pkg-idx-start pkg-idx-end is-file-p)
    Retrieve or create a logger. CATEGORIES -- List of category names SEPARATOR -- Category separator. Will only be used if logger did not exist before. CAT-CASE -- How each category case is treated. See NAMING-OPTION generic function for description FORCE-STRING-CASE -- Whenever elements of category which are strings, should also undergo case conversion according to CAT-CASE CREATEP -- Create the logger if it does not exist FILE -- pathname, source file being compiled PKG-IDX-START/PKG-IDX-END -- zero based indexes as to where in CATEGORIES package name starts ends, meaning of indexes is like SUBSEQ.. If package is unknown, both must be NIL For historical reason the above indexes are incremented by one before being stored in FLAGS slot, and functions LOGGER-PKG-IDX-START/END return them 1 based, with 0 being used as a flag that there is no package name in the category. IS-FILE-P -- T when its an actual SOURCE-FILE-LOGGER being requested, which is a special type of leaf logger representing the source file.
  • Function LOGGER-CHILDREN (logger)
    Return a freshly consed list of LOGGER's direct children
  • Function LOGGER-DESCENDANTS (logger &optional noselfp)
    Return a list of LOGGER's descendants. NOSELFP if T filters out Log4CL self-logger from descendants
  • Function LOGGER-ANCESTORS (logger)
    Return a list of logger's ancestors starting from parent and ending wit root logger
  • Function LOGGER-LOG-LEVEL (logger)
    Return the logger own log level or NIL if unset. Please note that by default loggers inherit their parent logger log level, see EFFECTIVE-LOG-LEVEL
  • Function LOGGER-APPENDERS (logger)
    Return the list of logger's own appenders. Please note that by default loggers inherit their parent logger appenders, see EFFECTIVE-APPENDERS
  • Function EFFECTIVE-APPENDERS (logger)
    Return the list of all appenders that logger output could possible go to, including inherited one
  • Function (setf LOGGER-LOG-LEVEL) (level logger)
    Set logger log level. Returns logger own log level
  • Function LOGGER-ADDITIVITY (logger)
    Return logger additivity
  • Function (setf LOGGER-ADDITIVITY) (additivity logger)
    Set logger appender additivity. Returns new additivity
  • Function SET-LOG-LEVEL (logger level &optional (adjust-p t))
    Set the log level of a logger. Log level is passed to MAKE-LOG-LEVEL to determine canonical log level. ADJUST-P controls if logger effective log level needs to be recalculated, the caller should NIL doing bulk operations that change the level of many loggers, as to avoid overhead. Returns if log level had changed as the 1st value and new level as the second value.
  • Function ADD-APPENDER (logger appender)
    Adds appender to the logger
  • Method APPENDER-ADDED (logger appender)
  • Method APPENDER-REMOVED (logger appender)
    Decrement logger count and call CLOSE-APPENDER if it reaches zero
  • Function REMOVE-APPENDER (logger appender)
    Removes APPENDER from the logger. APPENDER-REMOVED generic function will be called if appender was removed
  • Function REMOVE-ALL-APPENDERS (logger)
    Removes all appenders from the logger.
  • Function LOGGER-NAME (logger)
    Return the name of the logger category itself (without parent loggers)
  • Function LOGGER-FILE-LOGGER (logger)
    Return source file pathname where logger was instantiated
  • Function LOGGER-FILE (logger)
    Return source file pathname where logger was instantiated
  • Function LOGGER-FILE-NAMESTRING (logger)
    Return source file name string where logger was instantiated
  • Function LOGGER-CATEGORIES (logger)
    Return LOGGER categories starting from parent logger as a newly consed list of strings
  • Variable *ROOT-LOGGER*
    (log4cl-impl::%%create-root-logger)
    The one and only root logger
  • Macro WITH-LOG-INDENT ((&optional (indent '(1+ *log-indent*))) &body body)
    Executes forms in BODY with *LOG-INDENT* set to INDENT
  • Macro LOG-FATAL (&rest args &environment env)
    Submit log message to the logging system. Whenever the message is actually displayed or not depends on logging system configuration at run-time. The ARGS are parsed as follows: 1. Determine a logger object If first argument is a constant list, constant symbol or a keyword, it is made into a logger object as described in the MAKE-LOGGER macro documentation If first argument is a constant string, logger name is auto-determined from context as described in the MAKE-LOGGER macro documentation, and system proceeds to step 2. Otherwise any non-NIL first argument is assumed to be a form, that when evaluated will return a logger object. 2. If there are remaining arguments, they are used as format control string and format arguments, to be passed into the FORMAT function to produce the log message, when one is produced. If there were no other arguments, then this macro expands into a form, that will return T or NIL depending if logging with specified log level will actually produce any log messages. Note that having log level enabled does not necessary mean logging with log level is enabled, it also takes into account whenever log message will reach any appenders.
  • Macro LOG-ERROR (&rest args &environment env)
    Submit log message to the logging system. Whenever the message is actually displayed or not depends on logging system configuration at run-time. The ARGS are parsed as follows: 1. Determine a logger object If first argument is a constant list, constant symbol or a keyword, it is made into a logger object as described in the MAKE-LOGGER macro documentation If first argument is a constant string, logger name is auto-determined from context as described in the MAKE-LOGGER macro documentation, and system proceeds to step 2. Otherwise any non-NIL first argument is assumed to be a form, that when evaluated will return a logger object. 2. If there are remaining arguments, they are used as format control string and format arguments, to be passed into the FORMAT function to produce the log message, when one is produced. If there were no other arguments, then this macro expands into a form, that will return T or NIL depending if logging with specified log level will actually produce any log messages. Note that having log level enabled does not necessary mean logging with log level is enabled, it also takes into account whenever log message will reach any appenders.
  • Macro LOG-WARN (&rest args &environment env)
    Submit log message to the logging system. Whenever the message is actually displayed or not depends on logging system configuration at run-time. The ARGS are parsed as follows: 1. Determine a logger object If first argument is a constant list, constant symbol or a keyword, it is made into a logger object as described in the MAKE-LOGGER macro documentation If first argument is a constant string, logger name is auto-determined from context as described in the MAKE-LOGGER macro documentation, and system proceeds to step 2. Otherwise any non-NIL first argument is assumed to be a form, that when evaluated will return a logger object. 2. If there are remaining arguments, they are used as format control string and format arguments, to be passed into the FORMAT function to produce the log message, when one is produced. If there were no other arguments, then this macro expands into a form, that will return T or NIL depending if logging with specified log level will actually produce any log messages. Note that having log level enabled does not necessary mean logging with log level is enabled, it also takes into account whenever log message will reach any appenders.
  • Macro LOG-INFO (&rest args &environment env)
    Submit log message to the logging system. Whenever the message is actually displayed or not depends on logging system configuration at run-time. The ARGS are parsed as follows: 1. Determine a logger object If first argument is a constant list, constant symbol or a keyword, it is made into a logger object as described in the MAKE-LOGGER macro documentation If first argument is a constant string, logger name is auto-determined from context as described in the MAKE-LOGGER macro documentation, and system proceeds to step 2. Otherwise any non-NIL first argument is assumed to be a form, that when evaluated will return a logger object. 2. If there are remaining arguments, they are used as format control string and format arguments, to be passed into the FORMAT function to produce the log message, when one is produced. If there were no other arguments, then this macro expands into a form, that will return T or NIL depending if logging with specified log level will actually produce any log messages. Note that having log level enabled does not necessary mean logging with log level is enabled, it also takes into account whenever log message will reach any appenders.
  • Macro LOG-DEBUG (&rest args &environment env)
    Submit log message to the logging system. Whenever the message is actually displayed or not depends on logging system configuration at run-time. The ARGS are parsed as follows: 1. Determine a logger object If first argument is a constant list, constant symbol or a keyword, it is made into a logger object as described in the MAKE-LOGGER macro documentation If first argument is a constant string, logger name is auto-determined from context as described in the MAKE-LOGGER macro documentation, and system proceeds to step 2. Otherwise any non-NIL first argument is assumed to be a form, that when evaluated will return a logger object. 2. If there are remaining arguments, they are used as format control string and format arguments, to be passed into the FORMAT function to produce the log message, when one is produced. If there were no other arguments, then this macro expands into a form, that will return T or NIL depending if logging with specified log level will actually produce any log messages. Note that having log level enabled does not necessary mean logging with log level is enabled, it also takes into account whenever log message will reach any appenders.
  • Macro LOG-DEBU1 (&rest args &environment env)
    Submit log message to the logging system. Whenever the message is actually displayed or not depends on logging system configuration at run-time. The ARGS are parsed as follows: 1. Determine a logger object If first argument is a constant list, constant symbol or a keyword, it is made into a logger object as described in the MAKE-LOGGER macro documentation If first argument is a constant string, logger name is auto-determined from context as described in the MAKE-LOGGER macro documentation, and system proceeds to step 2. Otherwise any non-NIL first argument is assumed to be a form, that when evaluated will return a logger object. 2. If there are remaining arguments, they are used as format control string and format arguments, to be passed into the FORMAT function to produce the log message, when one is produced. If there were no other arguments, then this macro expands into a form, that will return T or NIL depending if logging with specified log level will actually produce any log messages. Note that having log level enabled does not necessary mean logging with log level is enabled, it also takes into account whenever log message will reach any appenders.
  • Macro LOG-DEBU2 (&rest args &environment env)
    Submit log message to the logging system. Whenever the message is actually displayed or not depends on logging system configuration at run-time. The ARGS are parsed as follows: 1. Determine a logger object If first argument is a constant list, constant symbol or a keyword, it is made into a logger object as described in the MAKE-LOGGER macro documentation If first argument is a constant string, logger name is auto-determined from context as described in the MAKE-LOGGER macro documentation, and system proceeds to step 2. Otherwise any non-NIL first argument is assumed to be a form, that when evaluated will return a logger object. 2. If there are remaining arguments, they are used as format control string and format arguments, to be passed into the FORMAT function to produce the log message, when one is produced. If there were no other arguments, then this macro expands into a form, that will return T or NIL depending if logging with specified log level will actually produce any log messages. Note that having log level enabled does not necessary mean logging with log level is enabled, it also takes into account whenever log message will reach any appenders.
  • Macro LOG-DEBU3 (&rest args &environment env)
    Submit log message to the logging system. Whenever the message is actually displayed or not depends on logging system configuration at run-time. The ARGS are parsed as follows: 1. Determine a logger object If first argument is a constant list, constant symbol or a keyword, it is made into a logger object as described in the MAKE-LOGGER macro documentation If first argument is a constant string, logger name is auto-determined from context as described in the MAKE-LOGGER macro documentation, and system proceeds to step 2. Otherwise any non-NIL first argument is assumed to be a form, that when evaluated will return a logger object. 2. If there are remaining arguments, they are used as format control string and format arguments, to be passed into the FORMAT function to produce the log message, when one is produced. If there were no other arguments, then this macro expands into a form, that will return T or NIL depending if logging with specified log level will actually produce any log messages. Note that having log level enabled does not necessary mean logging with log level is enabled, it also takes into account whenever log message will reach any appenders.
  • Macro LOG-DEBU4 (&rest args &environment env)
    Submit log message to the logging system. Whenever the message is actually displayed or not depends on logging system configuration at run-time. The ARGS are parsed as follows: 1. Determine a logger object If first argument is a constant list, constant symbol or a keyword, it is made into a logger object as described in the MAKE-LOGGER macro documentation If first argument is a constant string, logger name is auto-determined from context as described in the MAKE-LOGGER macro documentation, and system proceeds to step 2. Otherwise any non-NIL first argument is assumed to be a form, that when evaluated will return a logger object. 2. If there are remaining arguments, they are used as format control string and format arguments, to be passed into the FORMAT function to produce the log message, when one is produced. If there were no other arguments, then this macro expands into a form, that will return T or NIL depending if logging with specified log level will actually produce any log messages. Note that having log level enabled does not necessary mean logging with log level is enabled, it also takes into account whenever log message will reach any appenders.
  • Macro LOG-TRACE (&rest args &environment env)
    Submit log message to the logging system. Whenever the message is actually displayed or not depends on logging system configuration at run-time. The ARGS are parsed as follows: 1. Determine a logger object If first argument is a constant list, constant symbol or a keyword, it is made into a logger object as described in the MAKE-LOGGER macro documentation If first argument is a constant string, logger name is auto-determined from context as described in the MAKE-LOGGER macro documentation, and system proceeds to step 2. Otherwise any non-NIL first argument is assumed to be a form, that when evaluated will return a logger object. 2. If there are remaining arguments, they are used as format control string and format arguments, to be passed into the FORMAT function to produce the log message, when one is produced. If there were no other arguments, then this macro expands into a form, that will return T or NIL depending if logging with specified log level will actually produce any log messages. Note that having log level enabled does not necessary mean logging with log level is enabled, it also takes into account whenever log message will reach any appenders.
  • Macro LOG-DEBU5 (&rest args &environment env)
    Submit log message to the logging system. Whenever the message is actually displayed or not depends on logging system configuration at run-time. The ARGS are parsed as follows: 1. Determine a logger object If first argument is a constant list, constant symbol or a keyword, it is made into a logger object as described in the MAKE-LOGGER macro documentation If first argument is a constant string, logger name is auto-determined from context as described in the MAKE-LOGGER macro documentation, and system proceeds to step 2. Otherwise any non-NIL first argument is assumed to be a form, that when evaluated will return a logger object. 2. If there are remaining arguments, they are used as format control string and format arguments, to be passed into the FORMAT function to produce the log message, when one is produced. If there were no other arguments, then this macro expands into a form, that will return T or NIL depending if logging with specified log level will actually produce any log messages. Note that having log level enabled does not necessary mean logging with log level is enabled, it also takes into account whenever log message will reach any appenders.
  • Macro LOG-DEBU6 (&rest args &environment env)
    Submit log message to the logging system. Whenever the message is actually displayed or not depends on logging system configuration at run-time. The ARGS are parsed as follows: 1. Determine a logger object If first argument is a constant list, constant symbol or a keyword, it is made into a logger object as described in the MAKE-LOGGER macro documentation If first argument is a constant string, logger name is auto-determined from context as described in the MAKE-LOGGER macro documentation, and system proceeds to step 2. Otherwise any non-NIL first argument is assumed to be a form, that when evaluated will return a logger object. 2. If there are remaining arguments, they are used as format control string and format arguments, to be passed into the FORMAT function to produce the log message, when one is produced. If there were no other arguments, then this macro expands into a form, that will return T or NIL depending if logging with specified log level will actually produce any log messages. Note that having log level enabled does not necessary mean logging with log level is enabled, it also takes into account whenever log message will reach any appenders.
  • Macro LOG-DEBU7 (&rest args &environment env)
    Submit log message to the logging system. Whenever the message is actually displayed or not depends on logging system configuration at run-time. The ARGS are parsed as follows: 1. Determine a logger object If first argument is a constant list, constant symbol or a keyword, it is made into a logger object as described in the MAKE-LOGGER macro documentation If first argument is a constant string, logger name is auto-determined from context as described in the MAKE-LOGGER macro documentation, and system proceeds to step 2. Otherwise any non-NIL first argument is assumed to be a form, that when evaluated will return a logger object. 2. If there are remaining arguments, they are used as format control string and format arguments, to be passed into the FORMAT function to produce the log message, when one is produced. If there were no other arguments, then this macro expands into a form, that will return T or NIL depending if logging with specified log level will actually produce any log messages. Note that having log level enabled does not necessary mean logging with log level is enabled, it also takes into account whenever log message will reach any appenders.
  • Macro LOG-DEBU8 (&rest args &environment env)
    Submit log message to the logging system. Whenever the message is actually displayed or not depends on logging system configuration at run-time. The ARGS are parsed as follows: 1. Determine a logger object If first argument is a constant list, constant symbol or a keyword, it is made into a logger object as described in the MAKE-LOGGER macro documentation If first argument is a constant string, logger name is auto-determined from context as described in the MAKE-LOGGER macro documentation, and system proceeds to step 2. Otherwise any non-NIL first argument is assumed to be a form, that when evaluated will return a logger object. 2. If there are remaining arguments, they are used as format control string and format arguments, to be passed into the FORMAT function to produce the log message, when one is produced. If there were no other arguments, then this macro expands into a form, that will return T or NIL depending if logging with specified log level will actually produce any log messages. Note that having log level enabled does not necessary mean logging with log level is enabled, it also takes into account whenever log message will reach any appenders.
  • Macro LOG-DEBU9 (&rest args &environment env)
    Submit log message to the logging system. Whenever the message is actually displayed or not depends on logging system configuration at run-time. The ARGS are parsed as follows: 1. Determine a logger object If first argument is a constant list, constant symbol or a keyword, it is made into a logger object as described in the MAKE-LOGGER macro documentation If first argument is a constant string, logger name is auto-determined from context as described in the MAKE-LOGGER macro documentation, and system proceeds to step 2. Otherwise any non-NIL first argument is assumed to be a form, that when evaluated will return a logger object. 2. If there are remaining arguments, they are used as format control string and format arguments, to be passed into the FORMAT function to produce the log message, when one is produced. If there were no other arguments, then this macro expands into a form, that will return T or NIL depending if logging with specified log level will actually produce any log messages. Note that having log level enabled does not necessary mean logging with log level is enabled, it also takes into account whenever log message will reach any appenders.
  • Macro LOG-SEXP-WITH-LEVEL (level &rest sexps &environment env)
    Expands into LOG-<LEVEL> log statement that will print each element of SEXPS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. Constant string elements will be output directly. A pretty printer (pprint-newline :fill) format will be used as a separator between expressions, so that long expressions start on a new line, if *PRINT-PRETTY* is non-NIL Example: (let ((a 1) (b '(two three)) (c (loop for i from 1 to 15 collect i))) (log:sexp "values are" a b c)) will produce log message: [debug] - values are A=1 B=(TWO THREE) C=(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) Separator between expression and value, which defaults to equal sign, and a suffix after each value, which defaults to " ~:_" (a space followed by conditional newline) can be customized per package via NAMING-OPTION generic function
  • Macro LOG-SEXP-FATAL (&rest args)
    Expands into the log statement that will print each element of ARGS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. For constant string elements, it is output literally without printing its value. Example: (let ((a 1) (b '(two three))) (log-sexp "values are" a b)) will produce log message: [debug] - values are A=1 B=(TWO THREE)
  • Macro LOG-SEXP-ERROR (&rest args)
    Expands into the log statement that will print each element of ARGS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. For constant string elements, it is output literally without printing its value. Example: (let ((a 1) (b '(two three))) (log-sexp "values are" a b)) will produce log message: [debug] - values are A=1 B=(TWO THREE)
  • Macro LOG-SEXP-WARN (&rest args)
    Expands into the log statement that will print each element of ARGS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. For constant string elements, it is output literally without printing its value. Example: (let ((a 1) (b '(two three))) (log-sexp "values are" a b)) will produce log message: [debug] - values are A=1 B=(TWO THREE)
  • Macro LOG-SEXP-INFO (&rest args)
    Expands into the log statement that will print each element of ARGS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. For constant string elements, it is output literally without printing its value. Example: (let ((a 1) (b '(two three))) (log-sexp "values are" a b)) will produce log message: [debug] - values are A=1 B=(TWO THREE)
  • Macro LOG-SEXP-DEBUG (&rest args)
    Expands into the log statement that will print each element of ARGS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. For constant string elements, it is output literally without printing its value. Example: (let ((a 1) (b '(two three))) (log-sexp "values are" a b)) will produce log message: [debug] - values are A=1 B=(TWO THREE)
  • Macro LOG-SEXP-DEBU1 (&rest args)
    Expands into the log statement that will print each element of ARGS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. For constant string elements, it is output literally without printing its value. Example: (let ((a 1) (b '(two three))) (log-sexp "values are" a b)) will produce log message: [debug] - values are A=1 B=(TWO THREE)
  • Macro LOG-SEXP-DEBU2 (&rest args)
    Expands into the log statement that will print each element of ARGS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. For constant string elements, it is output literally without printing its value. Example: (let ((a 1) (b '(two three))) (log-sexp "values are" a b)) will produce log message: [debug] - values are A=1 B=(TWO THREE)
  • Macro LOG-SEXP-DEBU3 (&rest args)
    Expands into the log statement that will print each element of ARGS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. For constant string elements, it is output literally without printing its value. Example: (let ((a 1) (b '(two three))) (log-sexp "values are" a b)) will produce log message: [debug] - values are A=1 B=(TWO THREE)
  • Macro LOG-SEXP-DEBU4 (&rest args)
    Expands into the log statement that will print each element of ARGS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. For constant string elements, it is output literally without printing its value. Example: (let ((a 1) (b '(two three))) (log-sexp "values are" a b)) will produce log message: [debug] - values are A=1 B=(TWO THREE)
  • Macro LOG-SEXP-TRACE (&rest args)
    Expands into the log statement that will print each element of ARGS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. For constant string elements, it is output literally without printing its value. Example: (let ((a 1) (b '(two three))) (log-sexp "values are" a b)) will produce log message: [debug] - values are A=1 B=(TWO THREE)
  • Macro LOG-SEXP-DEBU5 (&rest args)
    Expands into the log statement that will print each element of ARGS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. For constant string elements, it is output literally without printing its value. Example: (let ((a 1) (b '(two three))) (log-sexp "values are" a b)) will produce log message: [debug] - values are A=1 B=(TWO THREE)
  • Macro LOG-SEXP-DEBU6 (&rest args)
    Expands into the log statement that will print each element of ARGS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. For constant string elements, it is output literally without printing its value. Example: (let ((a 1) (b '(two three))) (log-sexp "values are" a b)) will produce log message: [debug] - values are A=1 B=(TWO THREE)
  • Macro LOG-SEXP-DEBU7 (&rest args)
    Expands into the log statement that will print each element of ARGS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. For constant string elements, it is output literally without printing its value. Example: (let ((a 1) (b '(two three))) (log-sexp "values are" a b)) will produce log message: [debug] - values are A=1 B=(TWO THREE)
  • Macro LOG-SEXP-DEBU8 (&rest args)
    Expands into the log statement that will print each element of ARGS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. For constant string elements, it is output literally without printing its value. Example: (let ((a 1) (b '(two three))) (log-sexp "values are" a b)) will produce log message: [debug] - values are A=1 B=(TWO THREE)
  • Macro LOG-SEXP-DEBU9 (&rest args)
    Expands into the log statement that will print each element of ARGS in the form of ELEMENT=VALUE where ELEMENT will be the literal argument without evaluating it, and VALUE will be the result of evaluation. For constant string elements, it is output literally without printing its value. Example: (let ((a 1) (b '(two three))) (log-sexp "values are" a b)) will produce log message: [debug] - values are A=1 B=(TWO THREE)
  • Macro LOG-SEXP (&rest args)
  • Macro WITH-LOG-HIERARCHY ((hierarchy) &body body)
    Binds the *CURRENT-HIERARCHY* to the specified hierarchy for the dynamic scope of BODY. HIERARCHY can be hierarchy index or name
  • Macro WITH-PACKAGE-LOG-HIERARCHY (&body body)
    Binds the *CURRENT-HIERARCHY* to the unique hierarchy for the current package for the dynamic scope of BODY.
  • Macro IN-LOG-HIERARCHY (&optional hierarchy)
    Sets the *CURRENT-HIERARCHY* to specified hierarchy, or the default one when NIL
  • Macro IN-PACKAGE-LOG-HIERARCHY
    Sets the *CURRENT-HIERARCHY* to specified hierarchy, or the default one when NIL
  • Macro MAKE-LOGGER (&optional (arg nil arg-p) &environment env)
  • Macro WITH-NDC ((&optional (ndc nil ndcp)) &body body)
    Execute forms in BODY with *NDC-CONTEXT* set to CONTEXT. The context is printed by the %x pattern layout format
  • Variable +SELF-META-LOGGER+
    (let ((log4cl-impl::logger (log4cl-impl:make-logger '#:meta)))
      (setf (log4cl-impl:logger-additivity log4cl-impl::logger) nil)
      log4cl-impl::logger)
  • Class LAYOUT
    Abstract layout class
    No slots.
  • Generic-Function LAYOUT-TO-STREAM (layout stream logger level log-func)
    Prints the log message to the specified stream. log message can is specified indirectly by LOG-FUNC argument, which is a callable object that accepts a stream and writes log message to it
  • Class SIMPLE-LAYOUT  (LAYOUT)
    Simple layout outputs log level and user message separated by dash. For example: INFO - user log message
    No slots.
  • Method LAYOUT-TO-STREAM ((layout simple-layout) stream logger level log-func)
    Format the log message with the simple layout
  • Class PATTERN-LAYOUT  (LAYOUT)
    Pattern layout uses a configurable conversion pattern to format log messages. For example, the following patterns produce these log messages: "%-5p [%c] - %m%n" produces the message INFO [CATEGORY.SUBCATEGORY.NAME] - message text and "%-5p [%c{2}{:invert}{--}] - %m%n" produces the message: INFO [subcategory--name] - message text Syntax of conversion pattern is: %[<FLAGS>]<PATTERN-CHAR>[{<EXTRA-ARG>}...] FLAGS are consists of: [:][;<PREFIX>;][;<SUFFIX>;][-]<MIN>.<MAX> If a string resulting from the pattern expansion is longer then MAX its truncated by omitting characters from the start. Then if its shorter then MIN its padded with spaces to the right or left (when preceded by a minus) If PREFIX and/or SUFFIX is specified, then string is wrapped with them and all padding for justification, is done before the prefix and after the suffix. The length of prefix and suffix are not included into MIN/MAX or/padding calculations. Example: %-7;<;;>;p with p expanding to INFO, will produce the string " <INFO>" If : flag is specified, and string is empty, then no output is made, including not outputting any prefix or suffix. Performance considerations: All formatting is done without consing, except for the case of %m (user message) format, when it has MIN or MAX field width flags. That is because user message is passed around as a lambda that writes to the stream, and in order for its length to be known, (with-output-to-string) is used. Following pattern characters are recognized: -------------------------------------------------------------------- %p Log level string, for example DEBUG, INFO, TRACE. %P Log level string in lower case %c Full category name of the logger for example CL-USER:FOO:BAR. There can be up to three extra flags in curly braces. Extra flag can be a set of empty curly braces, in this case the effect is same as default value. First extra flag is PRECISION. When a single integer its a number of categories to display, parent categories will be omitted if logger is more then N levels deep. For example if logger category name is CL-USER:ONE:TWO:THREE then conversion pattern %c{2} will produce TWO:THREE When PRECISION is specified as {<FROM>,<COUNT>}, then it means categories starting at FROM (zero-based) and output <COUNT> categories. Negative or zero means until end of the categories. Example: Category printed for a logger named CL-USER:ONE:TWO:THREE Precision | Result ----------|---------------- {1} | THREE {2} | TWO:THREE {0,1} | CL-USER {5,1} | {1,1} | ONE {1,2} | ONE:TWO {1,0} | ONE:TWO:THREE {1,100} | ONE:TWO:THREE Second extra argument is SEPARATOR and will be a separator used between category names. If not present then the loggers native value will be used, which can be overwritten per package by NAMING-OPTION method Third extra argument if present, can be one of :UPCASE, :DOWNCASE or :INVERT and will result in printing of the category name in the corresponding manner, similar to using non-standard readtable-case For example when logger category is CL-USER.FOO.BAR outputting it with conversion pattern of %c{}{--}{:invert} will result print it as cl-user--foo--bar -------------------------------------------------------------------- %g - like to %c, but only portion of the categories that represent the package name %C - like to %c, but only portion of the categories that are not the package name. Example: assuming category separator setup for the package was a dot, and a (log:logger :one.two.three) was instantiated in package cl.dotted.package: %g => CL.DOTTED.PACKAGE %g{}{--}{:downcase} => cl--dotted--package %C => ONE.TWO.THREE (%C{}{ }{:downcase}) => (one two three) %F namestring of a file where logger was instantiated, same as returned by LOGGER-FILE-NAMESTRING -------------------------------------------------------------------- %d The date/time of the log message in UTC, extra argument can be a date pattern. Default date pattern is %d{%Y-%m-%d %H:%M:%S} To facilitate testing there can be optional second extra argument, which could be decimal value that will be used as universal time instead calling (GET-UNIVERSAL-TIME) Lisp does not have portable facility to get week and month names, so date format is printed by PATTERN-LAYOUT-FORMAT-DATE generic function, default method of which uses hard-coded English week/month/weekday names. Valid date format values are same as C strftime function, with GNU extensions. %A -- Full weekday name %A -- Abbreviated weekday name %B -- Full month name %b -- Abbreviated month name %c -- Standard date and time string %d -- Day of month as a decimal(01-31) %H -- Hour(00-23) %I -- Hour(01-12) %m -- Month as decimal(01-12) %M -- Minute as decimal(00-59) %p -- AM or PM %P -- am or pm %S -- Second as decimal(00-59) %y -- Year in decimal without century(0-99) %Y -- Year including century as decimal %z -- Time zone offset from UTC in -hhmm or +hhmm format %% -- The percent sign -------------------------------------------------------------------- %D date-time in local time, extra arguments can contain a strftime pattern %h hostname of the system (implementation dependent, obtained once when pattern is parsed, and cached %t Current thread name %x Value of *ndc-context* variable from (with-ndc (context)) macro %i Process id of the lisp process, implementation dependent. %I Two spaces repeated *log-indent* times. Different padding string can be specified in an extra argument. %n Mandatory newline, issues (TERPRI) on the stream. %:n issues (TERPRI) if *PRINT-PRETTY* is NIL or (PPRINT-NEWLINE :MANDATORY) otherwise %& Optional newline, issues FRESH-LINE on the stream %m Actual user log message. -------------------------------------------------------------------- PRETTY-PRINTER CONTROL %< and %> the formatting inside is wrapped into PPRINT-LOGICAL-BLOCK. Whenever pretty printing is actually used depends on runtime value of *PRINT-PRETTY* at call site The opening pattern can have extra arguments, with following meaning: %<{pretty}[{<num>}] - bind *PRINT-PRETTY* to T at runtime,if followed by a number, set *print-right-margin* to it %<{nopretty} - bind *PRINT-PRETTY* to NIL at runtime %<{package} - bind *PACKAGE* to :KEYWORD package %<{nopackage} - bind *PACKAGE* to original package Both pretty and package can be used together like this %<{pretty}{package} ... %> %_ conditional newline, issues (PPRINT-NEWLINE :linear) %:_ conditional newline, issues (PPRINT-NEWLINE :fill) %[<n>]N does (PPRINT-INDENT :block n). %:[<n>]N does (PPRINT-INDENT :current n). %<n1>.<n2>N is similar to above but the second argument of PPRINT-INDENT is calculated as (+ n1 (* n2 *LOG-INDENT*)). For example with %5.2N the wrapped lines will be indented default %I amount, plus extra 5 spaces.
    %PATTERN   Accessor: CONVERSION-PATTERN
    %FORMATTER
  • Method (setf CONVERSION-PATTERN) (pattern (layout pattern-layout))
  • Method LAYOUT-TO-STREAM ((layout pattern-layout) stream logger level log-func)
    Format the log statement with the pattern layout
  • Condition PATTERN-LAYOUT-ERROR  (LOG4CL-ERROR, PARSE-ERROR)
  • Function PATTERN-LAYOUT-ERROR (message &rest args)
  • Method CLOSE-APPENDER (appender)
  • Method SAVE-APPENDER (appender)
  • Class COUNTING-APPENDER  (APPENDER)
    Appender that counts Count the number of times APPENDER-DO-APPEND was called, and writes its output to null sink
    COUNT
  • Method APPENDER-DO-APPEND ((appender counting-appender) logger level log-func)
  • Method APPENDER-DO-APPEND ((appender counting-appender) logger level log-func)
  • Class TEMP-APPENDER
    A mixing for STREAM-APPENDER that will remove the appender if it encounters an error matching ERROR-TYPE
    ERROR-TYPE   Accessor: TEMP-APPENDER-ERROR-TYPE
  • Class SERIALIZED-APPENDER  (APPENDER)
    Appender that serializes itself using a lock
    %LOCK
  • Class STREAM-APPENDER  (SERIALIZED-APPENDER)
    Appender that writes message to stream. Stream is obtained on each output by calling APPENDER-STREAM function. Properties: IMMEDIATE-FLUSH : When non-NIL will call FINISH-OUTPUT after every log message FLUSH-INTERVAL : When set, will only flush if previous flush was earlier than FLUSH-INTERVAL seconds ago. In addition a background thread will be used to flush all appenders with FLUSH-INTERVAL set. See ADD-WATCH-TOKEN
    IMMEDIATE-FLUSH
    FLUSH-INTERVAL
    %LAST-FLUSH-TIME
    %OUTPUT-SINCE-FLUSH
  • Generic-Function APPENDER-STREAM (appender)
    Should return the stream to which appender will write log messages
  • Class FIXED-STREAM-APPENDER  (FIXED-STREAM-APPENDER-BASE)
    Appender that writes message to the stream in STREAM slot.
    STREAM   Accessor: APPENDER-STREAM
  • Class CONSOLE-APPENDER  (STREAM-APPENDER)
    A stream appender that writes messages to *TERMINAL-IO* stream, which must be a synonym stream
    No slots.
  • Class THIS-CONSOLE-APPENDER  (FIXED-STREAM-APPENDER, TEMP-APPENDER)
    An appender that captures the current value of *TERMINAL-IO* stream, and continues logging to it, until it encounters a stream error, at which point it will delete itself. To capture the target output stream, any chain of SYNONYM-STREAM or TWO-WAY-STREAM is followed recursively, until result is no longer either synonym or two way stream
    STREAM
  • Class TRICKY-CONSOLE-APPENDER  (THIS-CONSOLE-APPENDER)
    Captures the *TERMINAL-IO* stream just like the THIS-CONSOLE-APPENDER does, but at runtime checks if current value of *TERMINAL-IO* resolves to the same value and only writes the message if its different. When used together with CONSOLE-APPENDER, results that current REPL thread logs to REPL, while other threads log both to their *TERMINAL-IO* and REPL. Auto-deletes itself when encounters stream error
    No slots.
  • Method APPENDER-DO-APPEND ((this tricky-console-appender) logger level log-func)
  • Method APPENDER-ADDED (logger (appender stream-appender))
    Add appender to the watch tokens in the current hierarchy, unless IMMEDAITE-FLUSH property is set.
  • Method APPENDER-REMOVED (logger (appender stream-appender))
    When appender refcount is zero, remove it from watch tokens
  • Method WATCH-TOKEN-CHECK ((appender stream-appender))
  • Method APPENDER-DO-FLUSH ((appender stream-appender) time)
    Flush the non-immediate-flush appender unconditionally if there been any output. TIME will be used to mark the time of the flush
  • Function FLUSH-APPENDER (appender &optional (time (get-universal-time)))
    Immediately flush the appender output if necessary, marking the time of the flush with TIME
  • Function FLUSH-ALL-APPENDERS (&optional (all-hierarchies t))
    Flush any appenders that had output since being flushed
  • Method APPENDER-DO-APPEND ((this serialized-appender) logger level log-func)
  • Method APPENDER-DO-APPEND ((this stream-appender) logger level log-func)
  • Method APPENDER-DO-APPEND ((this fixed-stream-appender-base) logger level log-func)
  • Method APPENDER-STREAM ((this console-appender))
    Returns current value of *GLOBAL-CONSOLE*, which is a synonym stream for *TERMINAL-IO*
  • Generic-Function APPENDER-FILENAME (appender)
    Returns the appenders file name
  • Generic-Function APPENDER-NEXT-BACKUP-FILE (appender)
    Returns the appenders next backup file name
  • Generic-Function APPENDER-LAST-BACKUP-FILE (appender)
    Returns the appenders last backup file name
  • Class FILE-APPENDER-BASE  (FIXED-STREAM-APPENDER-BASE)
    Appender that writes to a file and closes it when its no longer attached to loggers
    STREAM-OWNER
  • Method CLOSE-APPENDER ((appender fixed-stream-appender-base))
  • Method SAVE-APPENDER ((appender fixed-stream-appender-base))
  • Class FILE-APPENDER  (FILE-APPENDER-BASE)
    Appender that writes to a file with a fixed file name
    FILENAME   Reader: APPENDER-FILENAME
  • Class ROLLING-FILE-APPENDER-BASE  (FILE-APPENDER-BASE)
    File appender that periodically checks if it needs to rollover the log file. Properties: ROLLOVER-CHECK-PERIOD : An integer, when current time advances past the boundary evenly divisible by this number a call to MAYBE-ROLL-FILE will be made to check if log file needs to be rolled over
    %ROLLOVER-CHECK-PERIOD
    %NEXT-ROLLOVER-TIME
  • Class DAILY-FILE-APPENDER  (ROLLING-FILE-APPENDER-BASE)
    An appender that writes to the file named by expanding a pattern. The expansion is done by the same converter as the %d conversion pattern of the PATTERN-LAYOUT, which is a subset of patterns supported by strftime POSIX function. Properties: NAME-FORMAT : Expanded with date formatter to get the name of the current log file BACKUP-NAME-FORMAT : Expanded with date formatter to get the name of the backup log file UTC-P : Should be non-NIL if name and backup patterns expand the UTC time instead of local. Defaults to NIL. MAYBE-ROLL-FILE method works as follows. It expands both name and backup format (if present). If either of them differs from their previous values, current log file will be closed, and a new current log file will be opened. The old log file will be renamed to %NEXT-BACKUP-NAME, which is a value of the backup format expansion remembered when original log file was opened. The new value of the backup format expansion is remembered in the %NEXT-BACKUP-NAME slot. In below examples it is assumed that current log file was created an 2012-02-21, and the event being logged is the first one on the next day. 1) Example: NAME-FORMAT is "test.log" and backup is unset, will always log to the file named test.log 2) Example: NAME-FORMAT is "test.%Y%m%d.log" and BACKUP-NAME-FORMAT is unset. Will log into the file test.20120221.log file, on the rollover it will be closed and test.20120222.file will be opened. 3) Example: NAME-FORMAT is "test.log" and BACKUP-NAME-FORMAT is "test.%Y%m%d.log". Will log into the file test.log. On rollover test.log will be renamed to test.20120221.log, and new test.log will be created. 4) Example: NAME-FORMAT is "test.%Y%m%d" and BACKUP-NAME-FORMAT is "test.log.bak". Will log into the file test.20120210.log and when the day changes, will rename it to test.log.bak (erasing old one if it exists)
    BACKUP-NAME-FORMAT
    NAME-FORMAT
    UTC-P
    %CURRENT-FILE-NAME   Reader: APPENDER-FILENAME
    %NEXT-BACKUP-NAME   Reader: APPENDER-NEXT-BACKUP-FILE
    %LAST-BACKUP-NAME   Reader: APPENDER-LAST-BACKUP-FILE
  • Method APPENDER-DO-APPEND ((this rolling-file-appender-base) logger level log-func)
  • Generic-Function MAYBE-ROLL-FILE (appender)
    Should rollover the log file file if needed
  • Generic-Function BACKUP-LOG-FILE (appender log-filename backup-filename)
    Should move or rename LOG-FILENAME into the BACKUP-FILENAME. When this function is called, LOG-FILENAME is already closed. Implemented as generic function so its possible to write extensions that compress the backup log files automatically, or append to them. One possible extension could be having daily log file and a weekly backup, that is appended to each day
  • Method BACKUP-LOG-FILE ((appender daily-file-appender) log-filename backup-filename)
  • Method BACKUP-LOG-FILE ((appender daily-file-appender) log-filename backup-filename)
  • Method BACKUP-LOG-FILE ((appender daily-file-appender) log-filename backup-filename)
  • Method BACKUP-LOG-FILE (appender log-filename backup-filename)
  • Method BACKUP-LOG-FILE (appender log-filename backup-filename)
  • Method BACKUP-LOG-FILE (appender log-filename backup-filename)
  • Method MAYBE-ROLL-FILE ((appender daily-file-appender))
    Expands FILENAME and BACKUP patterns, and if one of them changed, switches to the new log file
  • Method HANDLE-APPENDER-ERROR ((a temp-appender) c)
  • Function START-HIERARCHY-WATCHER-THREAD
  • Function STOP-HIERARCHY-WATCHER-THREAD
  • Function ALL-APPENDERS (&optional (all-hierarchies t))
    Return all existing appenders in all hierarchies
  • Function LOG-CONFIG (&rest args)
    Very DWIM oriented friendly way of configuring loggers and appenders. (LOG:CONFIG [LOGGER-IDENTIFIER] OPTION1 OPTION2...) LOGGER-IDENTIFIER is optional and defaults to the root logger. It can be one of the following: - Logger instance ie result of (LOG:CATEGORY) expansion, or any other form that returns a logger. - A list of logger categories, basically a shortcut for (LOG:CATEGORY '(CAT1 CAT2 CAT3)). An error will be given if logger does not exist. If you want to ensure logger is created, even if it did not exist before, use (LOG:CONFIG (LOG:CATEGORY ...) ...) Without any options (LOG:CONFIG) displays current configuration ---------------|--------------------------------------------------------------- Option | Description ---------------|--------------------------------------------------------------- MAIN OPTIONS. ---------------|--------------------------------------------------------------- :INFO | Or any other keyword identifying a log level, which can be :DEBUG | shortened to its shortest unambiguous prefix, such as :D. | Changes the logger level to that level. ---------------|--------------------------------------------------------------- :SANE | Removes logger appenders, then arranges for the logging output | to be always logged to dynamic value of *TERMINAL-IO* | | If used with :DAILY then console appender is not added, unless | :CONSOLE, :THIS-CONSOLE or :TRICKY-CONSOLE is also specified. | | The pattern layout added is affected by many of the pattern | options below. ---------------|--------------------------------------------------------------- APPENDER OPTIONS ---------------|--------------------------------------------------------------- :CONSOLE | Adds CONSOLE-APPENDER to the logger. Console appender logs | into current console as indicated by *TERMINAL-IO* stream ---------------|--------------------------------------------------------------- :THIS-CONSOLE | Adds THIS-CONSOLE-APPENDER to the logger. It captures the (or :THIS) | current value of *TERMINAL-IO* by recursively resolving any | synonym or two-way streams, and continues to log the | remembered value, even if it goes out dynamic scope. | | On any stream errors it will auto-remove itself. ---------------|--------------------------------------------------------------- :TRICKY-CONSOLE| Adds TRICKY-CONSOLE-APPENDER which acts exactly like (or :TRICKY) | THIS-CONSOLE appender above, but it checks if dynamic value | of *TERMINAL-IO* resolves to the same stream and ignores the | log message if it does. | | When debugging multi-threaded code from REPL, this results in | REPL thread logging to REPL, while threads with some other | value of *TERMINAL-IO* stream will output to both. | | As a shortcut, if THIS-CONSOLE is specified and global console | appender already exists, it will add TRICKY-CONSOLE instead. ---------------|--------------------------------------------------------------- :SANE2 | Shortcut for :SANE :TRICKY (mnemonic two -> multiple threads) ---------------|--------------------------------------------------------------- :STREAM stream| Changes the stream used for above two dedicated stream | appenders. ---------------|--------------------------------------------------------------- :DAILY FILE | Adds file appender logging to the named file, which will be | re-opened every day, with old log file renamed to FILE.%Y%m%d. | | Removes any other file based appenders from the logger. | | FILE can also contain %Y%m%d like pattern, expansion of which | will determine when new log file would be opened. ---------------|--------------------------------------------------------------- :FILTER level | Makes all appenders added by above keywords drop messages | below specified level. ---------------|--------------------------------------------------------------- LAYOUT OPTIONS General note about layout options, if any appender options are specified the layout options only affect PATTERN-LAYOUT for new appenders created by LOG:CONFIG command But if no appender options are specified, but layout options are, LOG:CONFIG will change the pattern layout on all console based appenders that output current *TERMINAL-IO* ---------------|--------------------------------------------------------------- :PATTERN | For any new appenders added, specifies the conversion pattern | for the PATTERN-LAYOUT. If not given, default pattern will be | used, modified by below options ---------------|--------------------------------------------------------------- :PRETTY | Add {pretty} option to the pattern to force pretty printing :NOPRETTY | Add {nopretty} option to the pattern to force no pretty printing | without one of these, global value is in effect ---------------|--------------------------------------------------------------- :TIME/:NOTIME | Include time into default pattern, default is :TIME ---------------|--------------------------------------------------------------- :FILE or | Include file name into default pattern, :FILE2 uses alternate :FILE2 | position for the file (in front of the package). :NOFILE | :NOFILE does not show the file ---------------|--------------------------------------------------------------- :THREAD | Include thread name into default pattern, it will be after the [<n>[<n2>]] | time, in [%t] format. If :THREAD argument is followed by one | or two numbers, they will be used as min/max field width. ---------------|--------------------------------------------------------------- :NDC | Include NDC context into default pattern, with optional min/max [<n>[<n2>]] | field width flags. When used together with :THREAD NDC will be | printed after the thread name, separated by dash, like this | example: "[threadname-ndc]"; it will not be shown if unbound | | Without :THREAD, its shown in its own square brackets, with | entire construct not shown if unbound. ---------------|--------------------------------------------------------------- :NOPACKAGE | Add {nopackage} option to the pattern (binds orig package at :PACKAGE | the site of the log statement. PACKAGE binds keyword package, | so everything is printed with package prefix ---------------|--------------------------------------------------------------- :TWOLINE | Changes pattern layout to print hard newline before actual log (or :2LINE) | message. Only makes sense with NOPRETTY or when logging into | files. | | Pretty printing does better job at line splitting then forced | two line layout, with short log statements placed on a single | line and longer ones wrapping. ---------------|--------------------------------------------------------------- ASSORTED OTHER OPTIONS ---------------|--------------------------------------------------------------- :PROPERTIES | Configure with PROPERTY-CONFIGURATOR by parsing specified FILE | properties file ---------------|--------------------------------------------------------------- :WATCH | Used with :PROPERTIES, uses watcher thread to check | properties file modification time, and reloads if it changes ---------------|--------------------------------------------------------------- :IMMEDIATE- | Used with :SANE, :DAILY or :CONSOLE to create new appenders FLUSH | with :IMMEDIATE-FLUSH T option, which prevents automatic | startup of hierarchy watcher thread, which is used for | auto-flushing. ---------------|--------------------------------------------------------------- :NOADDITIVE | Makes logger non-additive (does not propagate to parent) :OWN | Shortcut for non-additive (usually has appenders on its own) :ADDITIVE | Sets additive flag back to T. ---------------|--------------------------------------------------------------- :CLEAR | Reset the child in the hierarchy, by unsetting their log level | and/or removing appenders from them. Without any other flags | unset the log levels. | :LEVELS | Clears the log levels, this is the default :APPENDERS | Removes any appenders, levels will not be cleared unless | :LEVELS is also specified | :ALL | Normally :CLEAR does not touch non-additive loggers, that is | the ones that don't pass messages to parents. This flag forces | clearing of non-additive loggers | | Note that this option does not change the logger being acted | upon, just its children. See next option ---------------|--------------------------------------------------------------- :REMOVE <num> | Removes specific appender from the logger. Numbers are 1-based, | and are same ones displayed by LOG:CONFIG without arguments ---------------|--------------------------------------------------------------- :SELF | Configures the LOG4CL logger, which can be used to debug | Log4CL itself. Normally all other LOG:CONFIG hides the | it from view. ---------------|--------------------------------------------------------------- :FORCE-ADD | Normally if you specify :CONSOLE :THIS-CONSOLE or | :TRICKY-CONSOLE without :SANE (which clears out existing | appenders), an error will be given if there are any standard | console appenders that already log to *TERMINAL-IO* or :STREAM | argument. | | This is to prevent from creating duplicate output. | | Adding :FORCE-ADD flag skips the above check, and allows you | to add new console appender regardless. ---------------|--------------------------------------------------------------- :BACKUP | Used together with :DAILY, specifies the :BACKUP-NAME-FORMAT, | see docstring for the DAILY-FILE-APPENDER class. | | For example specifying a DAILY <file> :BACKUP NIL will always | log to statically named FILE without rolling. | | Defaults to NIL if FILE contains percent character or | FILE.%Y%m%d otherwise. ---------------|--------------------------------------------------------------- Examples: * (LOG:CONFIG :D) -- Changes root logger level to debug * (LOG:CONFIG :SANE) -- Drops all console appenders, change level to INFO, makes all output appear on current console * (LOG:CONFIG :SANE2) -- As above, but copy all other threads output to current terminal. * (LOG:CONFIG :PRETTY :THREAD) - changes active console appenders layout to force pretty printing and add thread info. * (LOG:CONFIG :NOPRETTY :PACKAGE) - changes layout to force no pretty printing, and restoring original *PACKAGE* when printing * (LOG:CONFIG :WARN :CLEAR) -- Changes root logger level to warnings, and unset child logger levels. * (LOG:CONFIG '(PACKAGE) :OWN :DEBUG :DAILY "package-log.%Y%m%d") Configures the logger PACKAGE with debug log level, logging into the file "package-log.20130510" which will be rolled over daily; makes logger non-additive so messages will not be propagated to logger parents. (To see them on console, remove the :OWN flag, or add :CONSOLE to the command) Note: in above example if package name is dotted, you need to specify the split category list, so if your package name is COM.EXAMPLE.FOO logger categories will be '(COM EXAMPLE FOO)
  • Function CLEAR-LOGGING-CONFIGURATION
    Delete all loggers configuration, leaving only LOG4CL-IMPL
  • Function RESET-LOGGING-CONFIGURATION
    Clear the logging configuration in the current hierarchy, and configure root logger with INFO log level and a simple console appender
  • Class CONFIGURATION-ELEMENT
    Holds logger and its log level
    LOGGER   Reader: LOGGER-OF
    LEVEL   Reader: LEVEL-OF
  • Class CONFIGURATION
    Used to remember log levels for a set of loggers
    NAME   Accessor: NAME-OF
    ELEMENTS   Accessor: ELEMENTS-OF
  • Variable *MAX-CONFIGURATIONS*
    30
    Maximum number of configurations in *CONFIGURATIONS* list
  • Variable *SAVE-CONFIGURATIONS-TO-FILE*
    t
    When non-NIL SAVE will also write configurations to a *CONFIGURATIONS-FILE*
  • Variable *CONFIGURATIONS-FILE*
    ".log4cl-configurations.lisp-expr"
    The file where configurations will be saved. Is merged with result of USER-HOMEDIR-PATHNAME
  • Function SAME-CONFIGURATION-P (c1 c2)
    Compare two logging configurations and return T if they have exactly same loggers and levels
  • Function SAVE (&optional name)
    Save current logging configuration into configuration list. NAME -- specifies the name of this logging configuration, if NAME is not specified, one is automatically provided as "Saved on <timestamp>". If its equivalent to some other configuration, save it only if it had a different name, otherwise lift the older equivalent configuration to the top of the list. When *SAVE-CONFIGURATIONS-TO-FILE* is T (default) the configuration list list will also be saved to a file ".log4cl-configurations.lisp-expr" in user home directory. File name can be customized by changing *CONFIGURATIONS-FILE* variable
  • Function RESTORE (&optional configuration from-end)
    Restore logging configuration CONFIGURATION, which can be a name, a CONFIGURATION instance, or a number indicating Nth (zero based) configuration in the *CONFIGURATIONS* list. NIL is treated as zero. When searching for the Before restoring the configuration, the current logging configuration is automatically saved under the name "Autosave <timestamp>", unless an equivalent configuration is already in the list If CONFIGURATION is NIL restores first element of *CONFIGURATIONS* that is not equivalent to the current configuration. So successive (RESTORE) will swap last two configurations
  • Function ALL-CONFIGURATIONS
    Returns the *CONFIGURATIONS* list
  • Function LIST-CONFIGURATIONS (&optional (stream *standard-output*))
    Prints the *CONFIGURATIONS* list
  • Class PROPERTY-PARSER
    Class for reading Java style property files.
    NAME-TOKEN-SEPARATOR
    NAME-TOKEN-READ-CASE
    %ORIG-INITARGS
  • Condition PROPERTY-PARSER-ERROR  (LOG4CL-ERROR, PARSE-ERROR)
  • Generic-Function PARSE-PROPERTY-STREAM (parser stream)
    Read stream and for each line that is not a comment, call PARSE-LINE function.
  • Method PARSE-PROPERTY-STREAM ((parser property-parser) stream)
  • Method PARSE-PROPERTY-STREAM ((parser property-parser) stream)
    Wrap errors with line number
  • Class PROPERTY-CONFIGURATOR  (PROPERTY-PARSER)
    Class that holds configurator state while parsing the properties file
    LOGGERS
    ADDITIVITY
    APPENDERS
  • Method PARSE-PROPERTY-STREAM ((configurator property-configurator) stream)
    Parse the stream and apply changes to logging configuration
  • Generic-Function CONFIGURE (configurator source &key &allow-other-keys)
    Configure the logging system from specified source
  • Method CONFIGURE ((configurator property-configurator) (s stream) &key)
    Configures logging from the specified stream
  • Method CONFIGURE ((configurator property-configurator) filespec &key auto-reload)
    Configures logging from the specified file. If AUTO-RELOAD is non-NIL, then after initial configuration will watch the file for modifications and re-configure when it changes. Note that auto-reload will not be configured if initial configuration signaled a error
  • Method WATCH-TOKEN-CHECK ((token property-configurator-file-watch))
    Checks properties file write time, and re-configure from it if it changed. Catches and does not re-signal PROPERTY-PARSER-ERROR, so watching the file continues if newly modified file had an error

LOG

No exported symbols.

Also exports

  • LOG4CL-IMPL:PACKAGE-OPTIONS
  • LOG4CL-IMPL:SAVE
  • LOG4CL-IMPL:RESTORE
  • LOG4CL-IMPL:WITH-NDC

log4cl-examples

TEST.PACKAGE.ONE

  • Function GREETINGS
  • Method FOOBAR (a b (c number))
  • Method FOOBAR ((a symbol) b (c (eql :ok)))
  • Method FOOBAR (a b (c (eql :ok)))
  • Method FOOBAR (a (b string) (c (eql :ok)))
  • Method FOOBAR ((a string) b (c (eql :ok)))
  • Method FOOBAR ((a string) (b string) (c (eql :ok)))
  • Method FOOBAR (a b (c (eql 42)))
  • Method FOOBAR (a b c)
  • Function (setf GREETINGS) (new-greeting)
  • Function FROM-A-LABEL (&optional runtime-logger-object)

CUSTOMIZE-LOG-EXPR

  • Function TEST

log4slime

LOG4CL.SLIME

  • Function EMACS-HELPER (info)
    This function grew up from a small helper, and desperately needs to be split into multiple ones, but I have no time right now
  • Function GET-BUFFER-LOG-MENU (&rest args)
  • Variable *SYSTEM-DIRECTORY*
    (make-pathname :name nil :type nil :defaults
                   #p"/root/.roswell/impls/all/all/quicklisp/dists/quicklisp/software/log4cl-20171201-git/src/log4slime.lisp")
  • Variable *QUICKLISP-DIRECTORY*
    (or (log4cl.slime::%try-getting-authoritative-quicklisp-directory)
        (make-pathname :name nil :type nil :defaults
                       (merge-pathnames
                        (make-pathname :directory '(:relative "quicklisp"))
                        (user-homedir-pathname))))
  • Function INSTALL (&key force (destination-directory *quicklisp-directory*) just-message)