[DAEMON-93] Persist logs to disk
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2019-09-10T04:51:15.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Appc Daemon 3.1.0 |
Components | appcd-core |
Labels | n/a |
Reporter | Chris Barber |
Assignee | Chris Barber |
Created | 2017-08-11T21:57:06.000+0000 |
Updated | 2019-09-10T04:51:15.000+0000 |
Description
The daemon needs to persist the log to disk. We can do this pretty easily by introducing a listener to the logger and writing the data to a log file. Every time the daemon is started, a fresh log file is created in
~/.appcelerator/appcd/log
.
We still need to determine a few things:
* Should we rotate old logs? Keep last 5 logs? gzip older logs?
* How should we handle log files that could potentially be huge?
The log messages should be streamed as objects containing metadata such as timestamps, etc. This structure should be preserved when written to disk.
As of v1.0.0, the daemon has a
appcd dump
command which generates a dump file including the logs.Added
server.persistDebugLog
config setting. Defaults tofalse
because there's no logrotate functionality and we don't want logs to eat up a bunch of space. https://github.com/appcelerator/appc-daemon/commit/efeb91690dd2b15c3ece3f53c1dd51e596a0f25d