Motion Logging

Description

Motion uses syslog for logging messages, but also stderr when it runs in no deamon mode.

Only running motion in no damon mode allows to define debug level for logging :

./motion -d 9

But it cannot be use from config files either changed from http control.

TODO

Improve motion logging system adding a new parameter in motion.conf to allow define level of logging system. This will imply to change all current log messages and define to which level belongs each one..

Allow use logging in a regular file instead of syslog.

PROGRESS

1-. Define 2 kind of logs :

1-. By Type : STR, ENC, NET, DBL, EVT, TRK, VID, ALL

log_type allows define any of this type to be logged or some of them together e.g. : log_type ENC|NET

2-. By Level : 1,9

Each Type have different levels of logs so this level is defined with log_level

log_type <STR | ENC | NET | DBL | EVT | TRK | VID | ALL>
log_level [1..9]

Examples

Log at level 3 for encoder only

log_type  ENC
log_level 3

Log at level 5 for video devices and track

log_type VID|TRK
log_level 5

Default

log_type  all
log_level 3

2-.Define log file

Add a new parameter to allow use a regular file or use syslog.

log_file <path_to_log_file|syslog|stderr|not defined>

* log_file is defined and path is valid a regular file will be used for logging messages but on fail will use default syslog/stderr
log_file /tmp/motion.log
log_file /dev/null

* not defined or value is syslog: syslog/stderr will be used
log_file syslog
log_file stderr
;log_fille 

* From Command-line ( log type is not case sensitive , so ENC and enc are equivalents ).
./motion -d 9 -k enc

-- AngelCarpintero - 12 Jul 2008

Is it possible to log the events into the syslog using "motion" as a tag or facility? How can we filter easily the traces from /var/log/messages?

-- OriolPalenzuela - 10 Mar 2009


Oriol, Looks good idea , adding a new log_type called events -> EVT.

-- AngelCarpintero - 10 Mar 2009


It's implemented since revision 501

-- AngelCarpintero - 03 Apr 2010


Topic revision: r11 - 05 Apr 2010 - 17:38:14 - AngelCarpintero
 
Motion - Motion Log
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.