Skip to content

[FEATURE] Configurable Logging Output (stderr vs file) with Default to File on Barebone Installations #2504

@azgaviperr

Description

@azgaviperr

What's needed and why?

Description:

It would be beneficial to introduce a configuration option in BunkerWeb WAF that allows users to choose whether logs should be sent to stderr or to a file. This feature would enhance flexibility for different deployment environments and align with best practices in logging management.

Proposed Behavior :

New configuration option: log_output = [stderr|file|both]

Default behavior:

On barebone installations, default to file logging to ensure logs are preserved and accessible even without a containerized or orchestrated environment.
On containerized environments (e.g., Docker), optionally default to stderr to align with container logging best practices.

Rationale :

Best Practices :

In containerized environments, logging to stderr is preferred as it integrates seamlessly with container runtimes and log aggregators (e.g., Docker, Kubernetes, Fluentd).

In bare-metal or minimal environments, logging to a file only ensures logs are not visible to unauthorized user.

Flexibility :

Users can tailor logging behavior to their infrastructure and operational needs.
Supports both modern DevOps workflows and traditional sysadmin setups.

Benefits :

Improved observability and debugging.
Better integration with log management systems.
Enhanced user control over logging behavior.

Backward Compatibility :

If the option is not specified, default to file to maintain current behavior and avoid breaking changes.

Implementations ideas (optional)

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions