hanshal101 commented on issue #6982: URL: https://github.com/apache/incubator-devlake/issues/6982#issuecomment-1962872563
Heyy @Maniacal, I'm new to Dev-Lake. Looking at the above feature request, I can see that you want to add a JOSNFormatter to view the logs in JSON format. Correct me if I am wrong. We need to add a conditional statement where if the LOGGING_FORMAT is set to JSON, we intend the log to be in JSON format; otherwise, text by default. We need to modify this file. https://github.com/apache/incubator-devlake/blob/00213f1833374897758b5c4a60be67d872de8d92/backend/impls/logruslog/init.go#L50-L53 Where the code should look something like this: ``` if format := os.Getenv("LOGGING_FORMAT"); format == "json" { inner.SetFormatter(&logrus.JSONFormatter{ TimestampFormat: time.DateTime }) } else { inner.SetFormatter(&logrus.TextFormatter{ TimestampFormat: time.DateTime, FullTimestamp: true, }) } ``` According to me, this is the possible solution. Please share your thoughts on this and tell me whether I should open a PR for it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
