spring-projects / spring-shell

Spring based shell
http://projects.spring.io/spring-shell/
Apache License 2.0
719 stars 395 forks source link

Add opinionated logging integration #1008

Open jvalkeal opened 6 months ago

jvalkeal commented 6 months ago

Backround; logging is hard especially with cli apps where whole infrastructure is designed for server applications.

While logging should be relatively fine with plain command output it will completely mess up terminal if there is any interactive components relying terminal escape characters.

In normal shell app you want to disable console logging:

logging:
  pattern:
    console:

And possibly add debug logs to a shell temporarily:

logging:
  file:
    name: shell.log
  level:
    root: debug
    org:
      springframework:
        shell: debug

Trouble with this is that you never get any errors if a shell hard fails at startup.

We should come up with custom opinionated logging configuration so that:

We'll keep this issue to collect ideas and other discussion to prepare a solution.