1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 09:52:20 +08:00

move eventlogs to an http endpoint

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
Jeromy
2015-06-16 19:45:53 -07:00
parent 152247dff2
commit a676b5a8ac
5 changed files with 77 additions and 7 deletions

View File

@ -368,13 +368,7 @@ func (r *FSRepo) openDatastore() error {
func configureEventLoggerAtRepoPath(c *config.Config, repoPath string) {
eventlog.Configure(eventlog.LevelInfo)
eventlog.Configure(eventlog.LdJSONFormatter)
rotateConf := eventlog.LogRotatorConfig{
Filename: path.Join(repoPath, "logs", "events.log"),
MaxSizeMB: c.Log.MaxSizeMB,
MaxBackups: c.Log.MaxBackups,
MaxAgeDays: c.Log.MaxAgeDays,
}
eventlog.Configure(eventlog.OutputRotatingLogFile(rotateConf))
eventlog.Configure(eventlog.Output(eventlog.WriterGroup))
}
// Close closes the FSRepo, releasing held resources.