Jovo Logger in a single line

v4

#1

Is there a way to make sure the logs from the JovoLogger are printed in a single line?

Pino and Pino Pretty have this option to print logs in a single line, which makes it easy to interpret and query them in Cloud Logging.
Feels like overkill to disable the default JovoLogger and replace it completely for this single purpose.

Thanks!


#2

This looks interesting. Do you have an example log and how you would like it to look?

Right now, it doesn’t seem like this is a feature supported by loglevel without customizations.

The functionality could be added to the JovoLogger class. Happy to take a look at a community PR for this.


#3

This seems to be almost working for the following config: logging: { enabled: true, indentation: new String('') }

‘Almost’ because on line 158 of BasicLogging.ts the indentation should be checked like on line 154 and 218:
JSON.stringify(requestCopy, null, this.config.indentation || 2)

@jan Is it possible to fix this bug? Thanks!


#4

Hey @Elisa_Lecluse. Thanks for flagging.

Here’s the fix: https://github.com/jovotech/jovo-framework/pull/1259

We will publish the update very soon.


#5

Thanks for fixing this!
Our issue has been resolved and we can confirm it’s working as described!