Skip to content

all-ride/ride-app-filtered-log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ride-app-filtered-log

This modules allows you to create a filtered log from your properties.

Options

You can specify some options in parameters.json, which will alter the behaviour of the log.

log.filtered.file

This parameter defaults to %application%/data/log/%environment%.filtered.log.

log.levels

This parameter takes an array of log levels.

Available levels are:

  • "E" for error
  • "I" for information
  • "W" for warning
  • "D" for debug

Example:

// parameters.json
{
    // ...

    "log.levels" : ["E", "I", "D", "W"]
}

log.fields

This parameter takes an array of fields which can be showed in your log messages. This order of the fields will determine the order in which they appear in log messages.

Available fields are:

  • "id" -"date" -"client" -"duration" -"source" -"memory" -"level" -"title" -"description"

Example:

// parameters.json
{
    // ...

    "log.fields" : ["duration", "source", "title", "description"]
}

log.sources

This parameter takes an array of sources. Examples are "app" or "database".

Example:

// parameters.json
{
    // ...

    "log.sources" : ["app", "controller"]
}

log.separator

A separator can be specified to override the default column separator. This parameter requires a string value.

Example:

// parameters.json
{
    // ...

    "log.separator" : "::"
}

log.colors

By enabling this option, the log will be colored. This parameter requires a boolean value.

Example:

// parameters.json
{
    // ...

    "log.colors" : true
}

log.file

Specify a different log file by providing a path.

Example:

// parameters.json
{
    // ...

    "log.file": "/sites/ridme/htdocs/debug.log",
}

Todo

  • Field specific colors.
  • Add a cli command to start logging with an optional specified config.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages