Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure Startup logging #13464

Closed
1 of 6 tasks
bjoe2k4 opened this issue Nov 8, 2020 · 6 comments
Closed
1 of 6 tasks

Configure Startup logging #13464

bjoe2k4 opened this issue Nov 8, 2020 · 6 comments
Labels
type/enhancement An improvement of existing functionality

Comments

@bjoe2k4
Copy link

bjoe2k4 commented Nov 8, 2020

  • Gitea version (or commit ref): gitea 1.12.5-1

  • Git version: 2.29.2, Wire Protocol Version 2 Enabled

  • Operating system: Archlinux x86_64 with the

  • Database (use [x]):

    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:

    • Yes (provide example URL)
    • No
  • Log gist:

Description

No matter how i configure [log] gitea always prints the following lines to console/systemd journal. I cannot even change anything (disable color, flags, etc...)

Nov 07 23:12:34 gitea[10129]: 2020/11/07 23:12:34 cmd/web.go:107:runWeb() [I] Starting Gitea on PID: 10129
Nov 07 23:12:34 gitea[10129]: 2020/11/07 23:12:34 ...dules/setting/git.go:93:newGit() [I] Git Version: 2.29.2, Wire Protocol Version 2 Enabled
Nov 07 23:12:34 gitea[10129]: 2020/11/07 23:12:34 routers/init.go:118:GlobalInit() [T] AppPath: /usr/bin/gitea
Nov 07 23:12:34 gitea[10129]: 2020/11/07 23:12:34 routers/init.go:119:GlobalInit() [T] AppWorkPath: /app/git/gitea-private
Nov 07 23:12:34 gitea[10129]: 2020/11/07 23:12:34 routers/init.go:120:GlobalInit() [T] Custom path: /app/git/gitea-private/custom
Nov 07 23:12:34 gitea[10129]: 2020/11/07 23:12:34 routers/init.go:121:GlobalInit() [T] Log path: /var/log/gitea-private
[log]
MODE = file
LEVEL = Critical

...

Screenshots

@zeripath
Copy link
Contributor

zeripath commented Nov 8, 2020

These are emitted before the logging has been setup so will always appear.

@bjoe2k4
Copy link
Author

bjoe2k4 commented Nov 10, 2020

How can this be logged before logging is setup? Shouldn't logging be the first thing to setup, and then do the routing business?

@zeripath
Copy link
Contributor

These are logged before the app.ini is read.

Now ... You can argue that they shouldn't be there but they're actually surprisingly helpful for debugging a number of situations when users don't have things set-up correctly. (Not that people ever seem to read them...)

@bjoe2k4
Copy link
Author

bjoe2k4 commented Nov 10, 2020

I agree with the usefulness of these log messages, but having no built-in way of turning them off after gitea is running smoothly shows room for improvement.

Anyways, I've modified my systemd service to just dump them to /dev/null.

StandardOutput=null

I'll leave this issue open as a reminder. If devs feel a wontfix, please close :-)

@noerw noerw added the type/enhancement An improvement of existing functionality label May 13, 2021
@thomas-mc-work
Copy link
Contributor

Would be great to get this sorted out as this breaks the line parsing feature in a central logging environment like ELK or Loki. The parsing pattern doesn't match when the format is different within a file or colorization comes into play.

@zeripath
Copy link
Contributor

zeripath commented Feb 9, 2022

Would be great to get this sorted out as this breaks the line parsing feature in a central logging environment like ELK or Loki. The parsing pattern doesn't match when the format is different within a file or colorization comes into play.

If you really do not want the initial 4 lines:

gitea web -q

@zeripath zeripath closed this as completed Feb 9, 2022
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

4 participants