n2n Page Rocket 1 API

n2n\log4php\appender\mongo

­Mongo­D­B

MongoDB extends LoggerAppender
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Constant summary

Property summary

Modifier and Type Property
protected host
protected port
protected databaseName
protected collectionName
protected userName
protected password
protected timeout
protected connection
protected MongoCollection collection

Methods summary

Modifier and Type Method
public __construct ( unknown name = '' )
public activateOptions ( )
public append ( LoggingEvent event )
protected array format ( LoggingEvent event )
protected array formatThrowable ( Exception ex )
public close ( )
public setHost ( string host )
public string getHost ( )
public setPort ( int port )
public int getPort ( )
public setDatabaseName ( string databaseName )
public string getDatabaseName ( )
public setCollectionName ( string collectionName )
public string getCollectionName ( )
public setUserName ( string userName )
public string getUserName ( )
public setPassword ( string password )
public string getPassword ( )
public setTimeout ( int timeout )
public int getTimeout ( )
public Mongo getConnection ( )
public MongoCollection getCollection ( )

Constants in detail

  • DEFAULT_MONGO_URL_PREFIX

    ­ const DEFAULT_MONGO_URL_PREFIX ­
  • DEFAULT_MONGO_HOST

    ­ const DEFAULT_MONGO_HOST ­
  • DEFAULT_MONGO_PORT

    ­ const DEFAULT_MONGO_PORT ­
  • DEFAULT_DB_NAME

    ­ const DEFAULT_DB_NAME ­
  • DEFAULT_COLLECTION_NAME

    ­ const DEFAULT_COLLECTION_NAME ­
  • DEFAULT_TIMEOUT_VALUE

    ­ const DEFAULT_TIMEOUT_VALUE ­

Properties in detail

  • host

    protected ­ ­ ­ host
  • port

    protected ­ ­ ­ port
  • databaseName

    protected ­ ­ ­ databaseName
  • collectionName

    protected ­ ­ ­ collectionName
  • userName

    protected ­ ­ ­ userName
  • password

    protected ­ ­ ­ password
  • timeout

    protected ­ ­ ­ timeout
  • connection

    protected ­ ­ ­ connection
  • collection

    protected ­ ­ MongoCollection ­ collection
    The collection to which log is written.
    var
    MongoCollection

Methods in detail

  • __construct

    public __construct ( unknown name = '' )
  • activateOptions

    public activateOptions ( )
    Setup db connection. Based on defined options, this method connects to the database and creates a $collection.
  • append

    public append ( LoggingEvent event )
    Appends a new event to the mongo database.
  • format

    array protected format ( LoggingEvent event )
    Converts the logging event into an array which can be logged to mongodb.
    param
    return
    array
  • formatThrowable

    array protected formatThrowable ( Exception ex )
    Converts an \Exception into an array which can be logged to mongodb. Supports innner exceptions (PHP >= 5.3)
    param
    Exception ex
    return
    array
  • close

    public close ( )
    Closes the connection to the logging database
  • setHost

    public setHost ( string host )
    Sets the value of $host parameter.
    param
    string host
  • getHost

    string public getHost ( )
    Returns the value of $host parameter.
    return
    string
  • setPort

    public setPort ( int port )
    Sets the value of $port parameter.
    param
    int port
  • getPort

    int public getPort ( )
    Returns the value of $port parameter.
    return
    int
  • setDatabaseName

    public setDatabaseName ( string databaseName )
    Sets the value of $databaseName parameter.
    param
    string databaseName
  • getDatabaseName

    string public getDatabaseName ( )
    Returns the value of $databaseName parameter.
    return
    string
  • setCollectionName

    public setCollectionName ( string collectionName )
    Sets the value of $collectionName parameter.
    param
    string collectionName
  • getCollectionName

    string public getCollectionName ( )
    Returns the value of $collectionName parameter.
    return
    string
  • setUserName

    public setUserName ( string userName )
    Sets the value of $userName parameter.
    param
    string userName
  • getUserName

    string public getUserName ( )
    Returns the value of $userName parameter.
    return
    string
  • setPassword

    public setPassword ( string password )
    Sets the value of $password parameter.
    param
    string password
  • getPassword

    string public getPassword ( )
    Returns the value of $password parameter.
    return
    string
  • setTimeout

    public setTimeout ( int timeout )
    Sets the value of $timeout parameter.
    param
    int timeout
  • getTimeout

    int public getTimeout ( )
    Returns the value of $timeout parameter.
    return
    int
  • getConnection

    Mongo public getConnection ( )
    Returns the mongodb connection.
    return
    n2n\log4php\appender\mongo\Mongo
  • getCollection

    MongoCollection public getCollection ( )
    Returns the active mongodb collection.
    return
    n2n\log4php\appender\mongo\MongoCollection