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

logging: log to console #8

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,18 @@ def _check_rmq_running():

def _rabbitmq_layer(self) -> dict:
"""Pebble layer definition for RabbitMQ."""
# NOTE(jamespage)
# Use the full path to the rabbitmq-server binary
# rather than the helper wrapper script to avoid
# redirection of console output to a log file.
return {
"summary": "RabbitMQ layer",
"description": "pebble config layer for RabbitMQ",
"services": {
RABBITMQ_SERVICE: {
"override": "replace",
"summary": "RabbitMQ Server",
"command": "rabbitmq-server",
"command": "/usr/lib/rabbitmq/bin/rabbitmq-server",
"startup": "enabled",
"user": RABBITMQ_USER,
"group": RABBITMQ_GROUP,
Expand Down Expand Up @@ -744,6 +748,10 @@ def _render_and_push_rabbitmq_conf(self) -> None:
cluster_partition_handling = autoheal

queue_master_locator = min-masters

# Log to console for pod logging
log.console = true
log.file = false
"""
logger.info("Pushing new rabbitmq.conf")
container.push(
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_rabbitmq_pebble_ready(self):
"rabbitmq": {
"override": "replace",
"summary": "RabbitMQ Server",
"command": "rabbitmq-server",
"command": "/usr/lib/rabbitmq/bin/rabbitmq-server",
"startup": "enabled",
"user": "rabbitmq",
"group": "rabbitmq",
Expand Down
Loading