From 63ab88672a79167119ad68dfbd131bf6427be26c Mon Sep 17 00:00:00 2001 From: Joshua Fernandes Date: Wed, 8 Apr 2020 20:32:57 +1000 Subject: [PATCH] adding support for a custom log4j file --- README.md | 1 + defaults/main.yml | 1 + templates/besu.service.j2 | 3 +++ 3 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 309b669..cd55449 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults | `besu_node_private_key_file` | "" | Path for node private key, if supplied. This needs to include the node key file name and path like so `/home/me/me_node/myPrivateKey`. If not supplied Besu will create one automatically | | `besu_data_dir` | /opt/besu/data | Path for data directory| | `besu_log_dir` | /var/log/besu | Path for logs | +| `besu_log4j_config_file` | "" | Absolute path for a custom log4j config file | | `besu_profile_file` | /etc/profile.d/besu-path.sh | Path to allow loading Besu into the system PATH | | `besu_managed_service` | true | Enables a systemd service (or launchd if on Darwin) | | `besu_launchd_dir` | /Library/LaunchAgents | The default launchd directory | diff --git a/defaults/main.yml b/defaults/main.yml index 5dfe18e..63ef8e4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -16,6 +16,7 @@ besu_config_dir: "/etc/besu" besu_config_template: "config.toml.j2" besu_data_dir: "{{ besu_base_dir }}/data" besu_log_dir: "/var/log/besu" +besu_log4j_config_file: "" besu_profile_file: "/etc/profile.d/besu-path.sh" # Managed service config diff --git a/templates/besu.service.j2 b/templates/besu.service.j2 index 4f3f764..65ff9cd 100644 --- a/templates/besu.service.j2 +++ b/templates/besu.service.j2 @@ -6,6 +6,9 @@ After=syslog.target network.target User={{ besu_user }} Group={{ besu_group }} Environment=HOME=/home/{{ besu_user }} +{% if besu_log4j_config_file %} +Environment=LOG4J_CONFIGURATION_FILE={{ besu_log4j_config_file }} +{% endif %} Environment=BESU_OPTS={{ besu_env_opts }} Type=simple {% if besu_cmdline_args %}