bluecherrydvr / bluecherry-apps-issues

1 stars 0 forks source link

Log events like motion, login attempts in bluecherry.log #142

Open antonsviridenko opened 7 years ago

antonsviridenko commented 7 years ago

1) motion event

I(id/camera name): Motion detected

2) successful login event

I(): user "username" logged in from xx.xx.xx.xx

3) failed login attempt

W(): failed login attempt for user "username" from xx.xx.xx.xx
quixand commented 7 years ago

It looks like you don't have a log handler in PHP, that would be a super-quick win for login auditing and any other GUI/ajax events

antonsviridenko commented 7 years ago

It looks like you don't have a log handler in PHP,

what exactly do you mean?

quixand commented 7 years ago

I had a look through the php in /usr/share/bluecherry/www (i think) I couldnt see anything handling logging. I don't have access to my test environment at the moment. its seems you have error and access logs from apache but thats it, please correct me if i'm wrong

antonsviridenko commented 7 years ago

Yes, that is, only apache access and error logs now. But syslog() is supported by PHP, I can log to bluecherry.log from PHP, I think there shouldn't be any problems

quixand commented 7 years ago

I've had some success with pear Log (https://pear.php.net/package/Log/) but on more recent projects i've gone to Monolog, its a bit more extendable and is the default in Symfony I think (https://github.com/Seldaek/monolog)