-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Gitea is ignoring log settings (HTTP logs go to /var/log/syslog instead of http.log) #4291
Comments
@denysobukh are you using systemd, or another similar service, to manage how gitea runs? |
Yes, I'm using systemd to run gitea:
|
I have the same issue; http.log is blank. This is probably because gitea just spits out http logs to stdout, which systemd then redirects to the syslog: https://unix.stackexchange.com/a/57243 If you run git from the command line you'll get this output. Workarounds include changing the ExecStart in the service file to redirect (via an ugly bash hack) to a log file in the gitea directory: https://stackoverflow.com/a/37595720 |
Upon further investigation it seems the go-macaron package is outputting these messages, and the fix needs to go at gitea/routers/routes/routes.go Line 49 in 95f0f62
Instead of macaron.New, it should be .NewWithLogger with an io.Writer bound to the open file http.log It looks like the only place http.log is used in this whole project is Line 77 in 5a62eb3
|
Any updates on which version this fix will include? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
Hi @denysobukh @jrkoenig is logging the macaron requests to the |
Hi @zeripath |
Ok so the gist is that the pr will redirect the Macaron log including its router logging to what is by default the gitea.log. (The issue with sending it to http.log is that I worry that there may be concurrency problems there.) Would that fix your issue? |
* Allow Macaron to be set to log through gitea.log Fix #4291
Hi All
|
I'm on 1.11.5, should I have this patch? Could someone explain the setting one should change to use the new method? I can't seem to stop getting the macaron logs in my systemd journal. |
@agaskins yes this has been part of Gitea since #5667 and was merged in to 1.8.0!
If after having read the above you still need help:
From the little your comment says, I think adding: [log]
...
REDIRECT_MACARON_LOG = true
MACARON = file
ROUTER = file Would work - however, you may want to consider dropping the router log with |
Gitea version 1.4.2 built with: bindata, sqlite
git version 2.17.1
Ubuntu 18.04 LTS
[x]
):Description:
Gitea is writing HTTP log messages to syslog instead of http.log
http.log is blank
app.ini
gitea dir
$ ls -la /var/lib/gitea/
gitea log dir
gitea.log
syslog
The text was updated successfully, but these errors were encountered: