Theme editor

Monolog Logging Service

Monolog Logging Service

Monolog Logging Service 4.1.1

XF 2.3 Addons · by Staraddons
0 Downloads 9 Views 0 Version
This XenForo 2.x addon adds logging functionality using the Monolog library
Price
Free
There are no downloadable versions available for this resource yet.

Overview Version (0) Discussion (1) License

  • Monolog Logging Service
    Monolog Logging Service
    This XenForo 2.x addon adds logging functionality using the Monolog library
    About this resource
    This XenForo 2.x addon adds logging functionality using the Monolog library from https://github.com/Seldaek/monolog

    Notes
    v3.x of this addon uses Monolog v1
    v4.x of this addon uses Monolog v2

    There is currently no difference in functionality between the two versions other than the version of Monolog used.

    Features
    • Log to a file
    • Send logs via email
    • Emailed logs are deduplicated and buffered
    • Configure minimum logging levels for files vs email logging
    • Add extra visitor data to logs: user_id and username
    • Add extra web data to logs: current request URI, request method and client IP
    • Test tool included to verify that logs are being written to disk - go to AdminCP > Tools > Checks and tests > Test Monolog
    Monolog Logging Service


    Usage Instructions

    By default, this addon will log events to a file called internal_data/monolog.log - this is configurable.

    To use the default logging facility, do the following in your addon code:

    PHP:
    Expand Collapse Copy
    use Monolog\Helper\Log;
    Log::info('an info message', ['context' => 'foo']);
    Log::error('an error message', ['data' => 'bar']);

    However, it is recommended that you create your own channel for your addon to make it easier to filter log entries:

    PHP:
    Expand Collapse Copy
    $logger = \XF::app()->get('monolog')->newChannel('myaddon');
    $logger->warning('a warning message', ['context' => 'foo']);

    Refer to the documentation for more detailed usage instructions for Monolog.

    You can create your own handler stack to customise how things are logged:

    PHP:
    Expand Collapse Copy
    use Monolog\Logger;
    
    $monolog = \XF::app()->get('monolog');
    $streamhandler = $monolog->stream(); // return our default stream handler for logging to a file
                                //(or create your own!)
    
    /** @var Monolog\Logger $logger */
    $logger = $monolog->logger('myaddon');
    $logger->pushHandler($streamhandler); // push our stream handler onto the handler stack
    // you can apply any other customisations you like here as well by adding custom handlers, formatters or processors
    
    $logger->critical('a critical message', ['context' => 'foo']);
  • Version
    There are no downloadable versions available for this resource yet.
  • Discussion

    This resource has a discussion thread on the forum where you can ask questions, report issues, and talk with the author and other users.

    Join the discussion (1)

  • License Terms

    By purchasing this resource, you are granted a license to use it on one (1) site, for as long as your license remains valid. You are not purchasing ownership of the underlying code.

    How your license works
    • Your license is checked automatically in the background. This never affects your site's visitors.
    • As long as your license is valid, this resource keeps working normally — even if our license server is briefly unreachable, a temporary network issue will never disable it.
    • Your license is bound to your site's domain the first time it's used.

    Moving to a new domain?
    Contact us and we'll move your license for you.

    What's included
    Updates and support for the period stated on this resource's page (see the Version tab for the current release).

    What's not allowed
    • Sharing your license with others, or using it on more than one site at a time
    • Removing or bypassing the license check in the code
Resource information
Category XF 2.3 Addons
Author Staraddons
Date Jan 15, 2026
Latest version 4.1.1
Statistics
Views 9
Downloads 0
Version 0
Developer
Staraddons
Resource author
More resources
Back
Top