Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging of statusengine #15

Closed
dhoffend opened this issue Jan 13, 2016 · 5 comments
Closed

Logging of statusengine #15

dhoffend opened this issue Jan 13, 2016 · 5 comments

Comments

@dhoffend
Copy link
Contributor

I've realized different things with the logging of statusengine cakephp application

  1. The LegacyShell Daemon uses a hardcoded file handler to write the output to

  2. The current hardcoded file handler logging doesn't log any timestamps in the logfile which makes it harder to analyse future possible problems or crashes.

  3. The current code doesn't support logfile rotation. StatusengineLegacyShell.php could reopen (close/open) the logfile on SIGHUP or similar to support log rotation.

  4. CakePHP provides a generic LogHandlerInterface which supports file, syslog and other handler. Is there a reason for not using the generic logging interface instead of fopen/fwrite? With generic logging and syslog you would tackle the logrotation problem also since logrotation can be taken care on the syslog server, etc

@nook24
Copy link
Owner

nook24 commented Jan 14, 2016

I would prefer to use SysLog so that Statusengine don't need to take care about log rotation and stuff like this.
And i like to replace LogfileTask with CakeLog class

@nook24
Copy link
Owner

nook24 commented Jan 14, 2016

Now the error output is back on stderr:
bildschirmfoto 2016-01-14 um 20 37 52
And all errors get logged to syslog:
bildschirmfoto 2016-01-14 um 20 38 00

Same for notices:
bildschirmfoto 2016-01-14 um 20 36 49

I changed syslog tag from Statusengine to statusengine so it's easy to grep for it. (After i took the screenshots...)

In the next step i will remove the LogfileTask.
See: 51db9b6

@dhoffend
Copy link
Contributor Author

Sounds great

nook24 added a commit that referenced this issue Jan 19, 2016
Statusengine is now using syslog as "statusengine" to resolve the issue #15
so Statusengine dont need to care about log rotating and stuff like this
@nook24 nook24 added the testing label Jan 19, 2016
@nook24
Copy link
Owner

nook24 commented Jan 19, 2016

Hi @dhoffend,
syslog support is done. Please checkout 38b360c to see if it fits your needs...

@nook24 nook24 mentioned this issue Feb 6, 2016
@nook24 nook24 added the resolved label Feb 6, 2016
@nook24
Copy link
Owner

nook24 commented Feb 6, 2016

Merged into new Version 1.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants