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

Support for Multiple Log File Names in Configuration #762

Open
stuxMY opened this issue Nov 26, 2024 · 0 comments
Open

Support for Multiple Log File Names in Configuration #762

stuxMY opened this issue Nov 26, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@stuxMY
Copy link

stuxMY commented Nov 26, 2024

Currently, the Nginx UI configuration allows specifying paths for access and error logs (AccessLogPath and ErrorLogPath). However, it does not support defining multiple specific log file names or utilizing wildcards (e.g., *.log) for log paths. This limitation requires either manual listing of individual log files or restricting log handling to a single file or directory, which can be cumbersome in environments with multiple log files.

Proposed Enhancement:

Add support for specifying multiple log file names in AccessLogPath and ErrorLogPath. This can be implemented in one or more of the following ways:

Support for Wildcards: Allow wildcards like *.log to include all matching files in the specified directory.

List of Log Files: Accept a comma-separated list of specific log file names.

Example:

AccessLogPath = /var/log/nginx/site-name/access.log, /var/log/nginx/site-name/access_api.log

Directory-Based Pattern Matching: Allow specifying a directory with an optional pattern filter for files (e.g., all .log files in a directory).

Example:

AccessLogPath = /var/log/nginx/site-name/*.log

Benefits:

Simplifies configuration in environments with multiple log files.
Reduces manual effort in listing log files explicitly.
Improves flexibility and usability for large-scale setups.

Implementation Considerations:

Add parsing logic to support lists and wildcards in configuration.
Ensure backward compatibility with existing configurations using single log file paths.
Implement validation to check that all specified log files exist and align with LogDirWhiteList.

Example Use Case:

For a project where Nginx generates multiple log files, such as:

/var/log/nginx/site-name/access.log
/var/log/nginx/site-name/access_api.log
/var/log/nginx/site-name/debug.log

The following configuration could be used:

[nginx]
AccessLogPath = /var/log/nginx/sites-name/*.log
ErrorLogPath = /var/log/nginx/sites-name/error.log
LogDirWhiteList = /var/log/nginx/site-name

Alternatives:

While scripting can be used to generate configurations dynamically, native support for multiple log file names and patterns would greatly simplify the process and reduce user error.

Additional Context:

Supporting this feature aligns with usability improvements for users managing logs in complex environments. It also provides flexibility for teams needing fine-grained log management across multiple files.

@stuxMY stuxMY added the enhancement New feature or request label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant