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

Customize log_format #564

Closed
gauravarora opened this issue Sep 8, 2016 · 3 comments
Closed

Customize log_format #564

gauravarora opened this issue Sep 8, 2016 · 3 comments

Comments

@gauravarora
Copy link

gauravarora commented Sep 8, 2016

I wanted to customize the log_format but it seems I cannot in the current form. I wanted to send over a PR but I just wanted to run the implementation by you once @jwilder.

I was planning of doing the implementation in the same fashion as /etc/nginx/proxy.conf. So I will use /etc/nginx/log_format.conf and include a default log_format if the file isn't present. Does that sound like a good solution?

@ghost
Copy link

ghost commented Jun 18, 2017

I tried to use custom log_format with the following steps:

  1. Put my custom log_format "combined_plus" definition in .conf file in the conf.d folder which then mounted inside nginx-proxy.
  2. Add access_log definition in vhost.d/domain.tld file (with the mount of vhost.d folder).

After that I've got an error:

unknown log format "combined_plus" in /etc/nginx/vhost.d/domain.tld:1

Upset.

@jwilder

@ghost
Copy link

ghost commented Jun 24, 2017

@jwilder Sorry for the false bug report - the problem was on my side. I've named the .conf file which contains log_format directive 'okmeter.conf' so it was loaded after default.conf which is the reason of the error. After I renamed it to '00-okmeter.conf' everything works like a charm.

I suggest this issue to be closed - log_format can be customized without any problem.

@tkw1536
Copy link
Collaborator

tkw1536 commented Apr 10, 2022

Closing as per last comment

@tkw1536 tkw1536 closed this as completed Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants