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

Hard-coded LogFormat definitions are hard-coded #678

Closed
skpy opened this issue Mar 13, 2014 · 9 comments
Closed

Hard-coded LogFormat definitions are hard-coded #678

skpy opened this issue Mar 13, 2014 · 9 comments

Comments

@skpy
Copy link

skpy commented Mar 13, 2014

This module hard-codes the LogFormat names in httpd.conf. That stinks for sites that rely on the X-Forwarded-For header on servers behind a load balancer.

We can use the CustomLog option on a per-vhost setting; but this means that we'd need to declare that option for every single vhost. That stinks, as it introduces a lot of repetition.

It'd be nice if the list of LogFormat definitions in httpd.conf could be added to, at the least.

@paul91
Copy link

paul91 commented Mar 14, 2014

I would also like to see this feature added.
On Mar 13, 2014 11:11 AM, "Scott Merrill" notifications@github.com wrote:

This module hard-codeshttps://github.com/puppetlabs/puppetlabs-apache/blob/master/templates/httpd.conf.erb#L54the LogFormat names in httpd.conf. That stinks for sites that rely on the
X-Forwarded-For header on servers behind a load balancer.

We can use the CustomLoghttps://github.com/puppetlabs/puppetlabs-apache/blob/master/templates/vhost.conf.erb#L43option on a per-vhost setting; but this means that we'd need to declare
that option for every single vhost. That stinks, as it introduces a lot of
repetition.

It'd be nice if the list of LogFormat definitions in httpd.conf could be
added to, at the least.

Reply to this email directly or view it on GitHubhttps://github.com//issues/678
.

@igalic
Copy link
Contributor

igalic commented Mar 14, 2014

+1

@skpy
Copy link
Author

skpy commented Mar 19, 2014

We worked around this by copying the httpd.conf.erb template into our role module, and using that version when implementing the apache class:

  class { '::apache':
    default_mods  => false,
    default_vhost => false,
    purge_configs => true,
    conf_template => 'role/httpd.conf.erb',
  }

In our copy of the template, we added the log directives we need. This works, but it means we need to track the puppetlabs/apache module a little more closely for changes.

@igalic
Copy link
Contributor

igalic commented Mar 19, 2014

Yeah, I can't imagine this to be very nice.
I'll take a stab at implementing this feature!

@igalic
Copy link
Contributor

igalic commented Mar 19, 2014

I highly welcome feedback on #682, while sliding down the hill to the office

@skpy
Copy link
Author

skpy commented Mar 19, 2014

Looks like a good start. Thanks for tackling this!
I'd add the following to params.pp:

  $log_formats = {
    combined => '%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"'
    common   => '%h %l %u %t \"%r\" %>s %b'
    referer  => '%{Referer}i -> %U'
    agent    => '%{User-agent}i'
  }

This should make this change transparent to current users, as it provides the same log format definitions as exist now.

@paul91
Copy link

paul91 commented Mar 19, 2014

I would like to second using those as the defaults. Other than that this patch is just what I need.

@igalic
Copy link
Contributor

igalic commented Mar 19, 2014

@skpy right now, I'm only appending new LogFormats to the list, I'm not replacing anything.

@chelnak
Copy link
Contributor

chelnak commented Mar 8, 2022

Hello! We are doing some house keeping and noticed that this issue has been open for a long time.

We're going to close it but please do raise another issue if the issue still persists. 😄

@chelnak chelnak closed this as completed Mar 8, 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

4 participants