Unable to set empty FLAGS for access log #4668

Closed
opened 2025-11-02 05:58:49 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @ghost on GitHub (Jan 17, 2020).

  • Gitea version (or commit ref): 1.10.2
  • Git version: 2.20.1
  • Operating system: Linux, Debian 10.2 (Buster)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I like to create a NCSA compliant access log, but by default the lines are prefixed by the stdflags:

2020/01/17 11:00:25 :0: [I] 127.0.0.1 - - [17/Jan/2020:11:00:25 +0100] "GET /img/avatar_default.png HTTP/1.0" 200 6237 "\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Firefox/68.0"

According to https://docs.gitea.io/en-us/logging-configuration/ the access logger should have the FLAGS set by default to an empty string, but that doesn't seem to be the case. Then I used the gitea configuration to set the FLAGS for the access logger to none, but that doesn't change anything.

As a test I changed the FLAGS to level and that has the expected effect, so my configuration method seems to be correct. But of course that's not what I want. I want an empty prefix in front of the access log data.

[INFO] 127.0.0.1 - - [17/Jan/2020:11:02:05 +0100] "GET /img/avatar_default.png HTTP/1.0" 304 0 "\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Firefox/68.0"

Here my log configuration:

[log]
MODE                 = file
LEVEL                = Warn
ENABLE_ACCESS_LOG    = true
ROOT_PATH            = /home/git/gitea/log
REDIRECT_MACARON_LOG = true
ROUTER               = file
ROUTER_LOG_LEVEL     = Debug
XORM                 = file

[log.file.access]
FLAGS                = none
LEVEL                = Info

Screenshots

Originally created by @ghost on GitHub (Jan 17, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.10.2 - Git version: 2.20.1 - Operating system: Linux, Debian 10.2 (Buster) - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description I like to create a NCSA compliant access log, but by default the lines are prefixed by the stdflags: ``` 2020/01/17 11:00:25 :0: [I] 127.0.0.1 - - [17/Jan/2020:11:00:25 +0100] "GET /img/avatar_default.png HTTP/1.0" 200 6237 "\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Firefox/68.0" ``` According to <https://docs.gitea.io/en-us/logging-configuration/> the access logger should have the `FLAGS` set by default to an empty string, but that doesn't seem to be the case. Then I used the gitea configuration to set the `FLAGS` for the access logger to `none`, but that doesn't change anything. As a test I changed the `FLAGS` to `level` and that has the expected effect, so my configuration method seems to be correct. But of course that's not what I want. I want an empty prefix in front of the access log data. ``` [INFO] 127.0.0.1 - - [17/Jan/2020:11:02:05 +0100] "GET /img/avatar_default.png HTTP/1.0" 304 0 "\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Firefox/68.0" ``` Here my log configuration: ``` [log] MODE = file LEVEL = Warn ENABLE_ACCESS_LOG = true ROOT_PATH = /home/git/gitea/log REDIRECT_MACARON_LOG = true ROUTER = file ROUTER_LOG_LEVEL = Debug XORM = file [log.file.access] FLAGS = none LEVEL = Info ``` ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
Author
Owner

@ghost commented on GitHub (Jan 18, 2020):

Will open a new issue with better description

@ghost commented on GitHub (Jan 18, 2020): Will open a new issue with better description
Author
Owner

@zeripath commented on GitHub (Jan 19, 2020):

This works on 1.11...

@zeripath commented on GitHub (Jan 19, 2020): This works on 1.11...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4668