Motion - Motion Log

Motion Logging


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.


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.


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]


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


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

* 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

Hi It seems that the three log_* configs do not work in the version I use (Ubuntu 14.04, motion Version 3.2.12). I have the following entries in motion.conf: log_file /run/shm/motion_test.log log_level 3 log_type ENC But still get "[err] ... Failed to read first camera header - giving up for now" in /var/log/user.log. What am I doing wrong?

-- AlAl - 28 Feb 2015

root@7th_odroid:/etc/motion# motion -n [0] Processing thread 0 - config file /etc/motion/motion.conf [0] Unknown config option "log_type" [0] Unknown config option "log_level" [0] Unknown config option "log_file" [0] Motion 3.2.12 Started ...

-- SeventhMotion - 18 May 2015

same here Unknown config option "log_type"

-- RobertoViola - 03 Jul 2015

For latest logging you must use latest trunk version

-- TosiaraT - 23 Jul 2015

Is it possible to disable logging completly?

-- MariuszCiszewski - 15 Jan 2016

how about set log file to /dev/null

-- ArifUsr - 08 May 2017
Topic revision: r17 - 08 May 2017, ArifUsr
Copyright © 1999-2024 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.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.