Theme editor

  • New XenForo Released Full Nulled 2.3.10 is available for download now. -> HERE
    New XenForo Released Upgrade Nulled 2.3.10 is available for download now. -> HERE
    XenForo Enhanced Search (XFES) 2.3.10 is available for download now. -> HERE
    XenForo Resource Manager (XFRM) 2.3.10 is available for download now. -> HERE
    XenForo Media Gallery (XFMG) 2.3.10 is available for download now. -> HERE

Monolog Logging Service

| XF 2.3 Add-ons (Free) Monolog Logging Service 4.1.1

No permission to download
💾 Resources submitted by: Staraddons • 💬 Posts: 1579 • 🏆 Points: 119 • 👍 Likes: 455 • ⬆️ Resources: 986
Language
English
Compatible XF 2.x versions
  1. 2.1
  2. 2.2
  3. 2.3
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']);
[Olakunlevpn] Popular Tags Cloud
| XF 2.3 Add-ons (Free) [Olakunlevpn] Popular Tags Cloud 1.0.2
AndyB Register email
| XF 2.3 Add-ons (Free) AndyB Register email 4.8
4.1.1
Version
0
Downloads
7
Views
First release
Last update
250.8 KB
File size
zip
Extension type
0.00 star(s) 0 ratings
Ratings
Uploader
Staraddons
Uploaded
986 Resources.
Available Tags:
  • Tags Tags
    None
  • More resources from Staraddons

    Back
    Top