-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make the logfiles use servername instead of name in their name. #2068
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
Conversation
Since we already use $ssl to add "_ssl" to the log filenames, and the examples for a mix of SSL and not typically would result in logfiles with names like "mix.example.com non-ssl_access.log" and "mix.example.com ssl_access_ssl.log", this patch fixes that by using $servername instead and thus getting what it probably more expected: "mix.example.com_access.log" and "mix.example.com_access_ssl.log"
Codecov Report
@@ Coverage Diff @@
## main #2068 +/- ##
=======================================
Coverage ? 58.49%
=======================================
Files ? 12
Lines ? 212
Branches ? 0
=======================================
Hits ? 124
Misses ? 88
Partials ? 0 Continue to review full report at Codecov.
|
|
Thanks for the suggested tweak @pstray . There's another PR currently open that is proposing changes in the same area: #2064 I'll discuss with the IAC Team on how we want to proceed with both of these changes. Both very useful, however, we need to take in to consideration how we publicise and version this, as there could be assumptions in place about log file name formats, for other tools, etc... |
|
Hi @pstray Further to my comment above, we have a ticket raised to implement this work and #2064's in a manner that will allow us to do it in a minor version bump: https://tickets.puppetlabs.com/browse/IAC-1186 We'll raise a PR that closes this one and request your review on it too. |
Prior to this commit, the `$filename` variable, which is used to construct the filename of Apache's various config and log files, obtained it's default value from the `$name` parameter. As puppetlabs#2064 highlights, it is possible for `$name` to contain spaces in it and this can cause cumbersome log file names, albeit POSIX compliant. Also related is puppetlabs#2068, which changes the `$filename` variable source from `$name` to `$servername`. This arguably seems more appropriate, especially given that `$servername` defaults to `$name` if undefined. This commit attempts to create a satisfactory solution to both puppetlabs#2064 and puppetlabs#2068 by introducing the `$use_servername_for_filenames` param. When set to `true`, a sanitized `$servername` parameter value will be used to construct `$filename`. When undefined or set to `$false`, it will retain the existing behaviour and use the `$name` parameter value. This will default to `false` until the next major release (v6.0.0), after which it will default to `true`. Then, in the subsequent major release (v7.0.0) it will be deprecated altogether and the default behaviour will be to use the sanitized value of `$servername` for the `$filename` var. Warning messages are output to the console to alert users of this change in behaviour. This commit introduces
Prior to this commit, the `$filename` variable, which is used to construct the filename of Apache's various config and log files, obtained it's default value from the `$name` parameter. As puppetlabs#2064 highlights, it is possible for `$name` to contain spaces in it and this can cause cumbersome log file names, albeit POSIX compliant. Also related is puppetlabs#2068, which changes the `$filename` variable source from `$name` to `$servername`. This arguably seems more appropriate, especially given that `$servername` defaults to `$name` if undefined. This commit attempts to create a satisfactory solution to both puppetlabs#2064 and puppetlabs#2068 by introducing the `$use_servername_for_filenames` param. When set to `true`, a sanitized `$servername` parameter value will be used to construct `$filename`. When undefined or set to `$false`, it will retain the existing behaviour and use the `$name` parameter value. This will default to `false` until the next major release (v6.0.0), after which it will default to `true`. Then, in the subsequent major release (v7.0.0) it will be deprecated altogether and the default behaviour will be to use the sanitized value of `$servername` for the `$filename` var. Warning messages are output to the console to alert users of this change in behaviour. This commit introduces
Prior to this commit, the `$filename` variable, which is used to construct the filename of Apache's various config and log files, obtained it's default value from the `$name` parameter. As puppetlabs#2064 highlights, it is possible for `$name` to contain spaces in it and this can cause cumbersome log file names, albeit POSIX compliant. Also related is puppetlabs#2068, which changes the `$filename` variable source from `$name` to `$servername`. This arguably seems more appropriate, especially given that `$servername` defaults to `$name` if undefined. This commit attempts to create a satisfactory solution to both puppetlabs#2064 and puppetlabs#2068 by introducing the `$use_servername_for_filenames` param. When set to `true`, a sanitized `$servername` parameter value will be used to construct `$filename`. When undefined or set to `$false`, it will retain the existing behaviour and use the `$name` parameter value. This will default to `false` until the next major release (v6.0.0), after which it will default to `true`. Then, in the subsequent major release (v7.0.0) it will be deprecated altogether and the default behaviour will be to use the sanitized value of `$servername` for the `$filename` var. Warning messages are output to the console to alert users of this change in behaviour. This commit introduces
Prior to this commit, the `$filename` variable, which is used to construct the filename of Apache's various config and log files, obtained it's default value from the `$name` parameter. As puppetlabs#2064 highlights, it is possible for `$name` to contain spaces in it and this can cause cumbersome log file names, albeit POSIX compliant. Also related is puppetlabs#2068, which changes the `$filename` variable source from `$name` to `$servername`. This arguably seems more appropriate, especially given that `$servername` defaults to `$name` if undefined. This commit attempts to create a satisfactory solution to both puppetlabs#2064 and puppetlabs#2068 by introducing the `$use_servername_for_filenames` param. When set to `true`, a sanitized `$servername` parameter value will be used to construct `$filename`. When undefined or set to `$false`, it will retain the existing behaviour and use the `$name` parameter value. This will default to `false` until the next major release (v6.0.0), after which it will default to `true`. Then, in the subsequent major release (v7.0.0) it will be deprecated altogether and the default behaviour will be to use the sanitized value of `$servername` for the `$filename` var. Warning messages are output to the console to alert users of this change in behaviour.
Prior to this commit, the `$filename` variable, which is used to construct the filename of Apache's various config and log files, obtained it's default value from the `$name` parameter. As puppetlabs#2064 highlights, it is possible for `$name` to contain spaces in it and this can cause cumbersome log file names, albeit POSIX compliant. Also related is puppetlabs#2068, which changes the `$filename` variable source from `$name` to `$servername`. This arguably seems more appropriate, especially given that `$servername` defaults to `$name` if undefined. This commit attempts to create a satisfactory solution to both puppetlabs#2064 and puppetlabs#2068 by introducing the `$use_servername_for_filenames` param. When set to `true`, a sanitized `$servername` parameter value will be used to construct `$filename`. When undefined or set to `$false`, it will retain the existing behaviour and use the `$name` parameter value. This will default to `false` until the next major release (v6.0.0), after which it will default to `true`. Then, in the subsequent major release (v7.0.0) it will be deprecated altogether and the default behaviour will be to use the sanitized value of `$servername` for the `$filename` var. Warning messages are output to the console to alert users of this change in behaviour.
Prior to this commit, the `$filename` variable, which is used to construct the filename of Apache's various config and log files, obtained it's default value from the `$name` parameter. As puppetlabs#2064 highlights, it is possible for `$name` to contain spaces in it and this can cause cumbersome log file names, albeit POSIX compliant. Also related is puppetlabs#2068, which changes the `$filename` variable source from `$name` to `$servername`. This arguably seems more appropriate, especially given that `$servername` defaults to `$name` if undefined. This commit attempts to create a satisfactory solution to both puppetlabs#2064 and puppetlabs#2068 by introducing the `$use_servername_for_filenames` param. When set to `true`, a sanitized `$servername` parameter value will be used to construct `$filename`. When undefined or set to `$false`, it will retain the existing behaviour and use the `$name` parameter value. This will default to `false` until the next major release (v6.0.0), after which it will default to `true`. Then, in the subsequent major release (v7.0.0) it will be deprecated altogether and the default behaviour will be to use the sanitized value of `$servername` for the `$filename` var. Warning messages are output to the console to alert users of this change in behaviour.
|
Yes that seems like a good way to do it |
Prior to this commit, the `$filename` variable, which is used to construct the filename of Apache's various config and log files, obtained it's default value from the `$name` parameter. As puppetlabs#2064 highlights, it is possible for `$name` to contain spaces in it and this can cause cumbersome log file names, albeit POSIX compliant. Also related is puppetlabs#2068, which changes the `$filename` variable source from `$name` to `$servername`. This arguably seems more appropriate, especially given that `$servername` defaults to `$name` if undefined. This commit attempts to create a satisfactory solution to both puppetlabs#2064 and puppetlabs#2068 by introducing the `$use_servername_for_filenames` param. When set to `true`, a sanitized `$servername` parameter value will be used to construct `$filename`. When undefined or set to `$false`, it will retain the existing behaviour and use the `$name` parameter value. This will default to `false` until the next major release (v6.0.0), after which it will default to `true`. Then, in the subsequent major release (v7.0.0) it will be deprecated altogether and the default behaviour will be to use the sanitized value of `$servername` for the `$filename` var. Warning messages are output to the console to alert users of this change in behaviour.
Prior to this commit, the `$filename` variable, which is used to construct the filename of Apache's various config and log files, obtained it's default value from the `$name` parameter. As puppetlabs#2064 highlights, it is possible for `$name` to contain spaces in it and this can cause cumbersome log file names, albeit POSIX compliant. Also related is puppetlabs#2068, which changes the `$filename` variable source from `$name` to `$servername`. This arguably seems more appropriate, especially given that `$servername` defaults to `$name` if undefined. This commit attempts to create a satisfactory solution to both puppetlabs#2064 and puppetlabs#2068 by introducing the `$use_servername_for_filenames` param. When set to `true`, a sanitized `$servername` parameter value will be used to construct `$filename`. When undefined or set to `$false`, it will retain the existing behaviour and use the `$name` parameter value. This will default to `false` until the next major release (v6.0.0), after which it will default to `true`. Then, in the subsequent major release (v7.0.0) it will be deprecated altogether and the default behaviour will be to use the sanitized value of `$servername` for the `$filename` var. Warning messages are output to the console to alert users of this change in behaviour.
Since we already use $ssl to add "_ssl" to the log filenames, and the
examples for a mix of SSL and not typically would result in logfiles
with names like "mix.example.com non-ssl_access.log" and
"mix.example.com ssl_access_ssl.log", this patch fixes that by using
$servername instead and thus getting what it probably more expected:
"mix.example.com_access.log" and "mix.example.com_access_ssl.log"