mirror of
https://github.com/KevinMidboe/planetposen-images.git
synced 2025-10-28 21:00:12 +00:00
No longer log to file, just stdout
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
package logger
|
package logger
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Event stores messages to log later, from our standard interface
|
// Event stores messages to log later, from our standard interface
|
||||||
@@ -22,9 +23,7 @@ func InitLogger() *ApplicationLogger {
|
|||||||
var baseLogger = logrus.New()
|
var baseLogger = logrus.New()
|
||||||
var applicationLogger = &ApplicationLogger{baseLogger}
|
var applicationLogger = &ApplicationLogger{baseLogger}
|
||||||
|
|
||||||
f, _ := os.OpenFile("/var/log/planetposen-logs/planetposen-images.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
|
applicationLogger.SetOutput(os.Stdout)
|
||||||
|
|
||||||
applicationLogger.SetOutput(f)
|
|
||||||
applicationLogger.Formatter = &logrus.JSONFormatter{
|
applicationLogger.Formatter = &logrus.JSONFormatter{
|
||||||
TimestampFormat: time.RFC3339Nano,
|
TimestampFormat: time.RFC3339Nano,
|
||||||
FieldMap: logrus.FieldMap{
|
FieldMap: logrus.FieldMap{
|
||||||
|
|||||||
Reference in New Issue
Block a user