Coder Social home page Coder Social logo

zf3belcebur-mongodb-logger's Introduction

zf3-mongodb-logger

MongoDB Logger

See

Installation

Installation of this module uses composer. For composer documentation, please refer to getcomposer.org.

composer require zf3belcebur/mongodb-logger

Then add ZF3Belcebur\MongoDBLogger to your config/application.config.php and copy config/zf3belcebur-mongodb-logger.global.php.dist to your autoload config folder

namespace ZF3Belcebur\MongoDBLogger;

use ZF3Belcebur\MongoDBLogger\Factory\ErrorLoggerFactory;
use ZF3Belcebur\MongoDBLogger\Factory\ExceptionLoggerFactory;
use ZF3Belcebur\MongoDBLogger\Factory\FatalErrorLoggerFactory;
use ZF3Belcebur\MongoDBLogger\Factory\Request2XXLoggerFactory;
use ZF3Belcebur\MongoDBLogger\Factory\Request3XXLoggerFactory;
use ZF3Belcebur\MongoDBLogger\Factory\Request4XXLoggerFactory;
use ZF3Belcebur\MongoDBLogger\Factory\Request5XXLoggerFactory;
use Zend\Log\Processor\RequestId;

return [
    'service_manager' => [
        'factories' => [
            FatalErrorLoggerFactory::SERVICE_NAME => FatalErrorLoggerFactory::class,
            ErrorLoggerFactory::SERVICE_NAME => ErrorLoggerFactory::class,
            ExceptionLoggerFactory::SERVICE_NAME => ExceptionLoggerFactory::class,
            Request2XXLoggerFactory::SERVICE_NAME => Request2XXLoggerFactory::class,
            Request3XXLoggerFactory::SERVICE_NAME => Request3XXLoggerFactory::class,
            Request4XXLoggerFactory::SERVICE_NAME => Request4XXLoggerFactory::class,
            Request5XXLoggerFactory::SERVICE_NAME => Request5XXLoggerFactory::class,
        ],
    ],
    __NAMESPACE__ => [
        'writers' => [
            'defaultOptions' => [
                'manager' => [
                    'uri' => 'mongodb://127.0.0.1/',
                    'uriOptions' => [],
                    'driverOptions' => [],
                ],
                'database' => 'rubi_log',
                'collection' => 'base',
                'writeConcern' => null,
                'formatter' => null,
                'filters' => [],
            ],
            ErrorLoggerFactory::SERVICE_NAME => [
                'collection' => 'error_handler',
            ],
            ExceptionLoggerFactory::SERVICE_NAME => [
                'collection' => 'exception',
            ],
            FatalErrorLoggerFactory::SERVICE_NAME => [
                'collection' => 'fatal_error',
            ],
            Request2XXLoggerFactory::SERVICE_NAME => [
                'collection' => 'request_2xx',
            ],
            Request3XXLoggerFactory::SERVICE_NAME => [
                'collection' => 'request_3xx',
            ],
            Request4XXLoggerFactory::SERVICE_NAME => [
                'collection' => 'request_4xx',
            ],
            Request5XXLoggerFactory::SERVICE_NAME => [
                'collection' => 'request_5xx',
            ],
        ],
        'processors' => [
            'default' => [
                'requestId' => [
                    'name' => RequestId::class,
                ],
            ],
        ],
        'loggers' => [
            FatalErrorLoggerFactory::SERVICE_NAME => [
                'enable' => true,
            ],
            ErrorLoggerFactory::SERVICE_NAME => [
                'enable' => true,
            ],
            ExceptionLoggerFactory::SERVICE_NAME => [
                'enable' => true,
            ],
            Request2XXLoggerFactory::SERVICE_NAME => [
                'enable' => true,
            ],
            Request3XXLoggerFactory::SERVICE_NAME => [
                'enable' => true,
            ],
            Request4XXLoggerFactory::SERVICE_NAME => [
                'enable' => true,
            ],
            Request5XXLoggerFactory::SERVICE_NAME => [
                'enable' => true,
            ],
        ],
    ],
];

Custom Configuration

You can enable or disable each logger and override the logger settings.

zf3belcebur-mongodb-logger's People

Contributors

davidgarciagordo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.