Skip to content

Commit

Permalink
Finer log configuration (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mageti authored and inkatze committed Dec 24, 2019
1 parent 843b0ad commit 482e95e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
9 changes: 8 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ wildfly_create_symlink: true

wildfly_init_src_path: "{{ 'docs/contrib/scripts' if wildfly_major_v | version_compare('10', '>=') else 'bin' }}"

wildfly_console_log_dir: "/var/log/wildfly"
wildfly_log_dir: "/var/log/wildfly"
wildfly_console_log_dir: "{{ wildfly_log_dir }}"
wildfly_console_log_file: "console.log"
wildfly_console_log: "{{ wildfly_console_log_dir }}/\
{{ wildfly_console_log_file }}"
wildfly_boot_log_dir: "{{ wildfly_log_dir }}"
wildfly_boot_log_file: "boot.log"
wildfly_boot_log: "{{ wildfly_console_log_dir }}/{{ wildfly_boot_log_file }}"
wildfly_server_log_dir: "{{ wildfly_log_dir }}"
wildfly_server_log_file: "server.log"
wildfly_server_log: "{{ wildfly_server_log_dir }}/{{ wildfly_server_log_file }}"

wildfly_conf_dir: /etc/wildfly
wildfly_standalone_config_file: standalone.xml
Expand Down
15 changes: 14 additions & 1 deletion tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@
group: '{{ wildfly_group }}'
mode: '0750'

- name: Create wildfly log directories
file:
path: '{{ item }}'
state: directory
owner: '{{ wildfly_user }}'
group: '{{ wildfly_group }}'
mode: '0750'
loop:
- "{{ wildfly_log_dir }}"
- "{{ wildfly_console_log_dir }}"
- "{{ wildfly_boot_log_dir }}"
- "{{ wildfly_server_log_dir }}"

- name: Copy wildfly configuration
template:
src: wildfly.conf.j2
Expand Down Expand Up @@ -90,7 +103,7 @@
enabled: yes
- name: Wait for wildfly to start
wait_for:
path: "{{ wildfly_dir }}/standalone/log/server.log"
path: "{{ wildfly_server_log }}"
search_regex: 'started in'
when: wildfly_manage_service

Expand Down
1 change: 1 addition & 0 deletions templates/wildfly.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ SHUTDOWN_WAIT={{ wildfly_shutdown_wait }}

## Location to keep the console log
JBOSS_CONSOLE_LOG="{{ wildfly_console_log }}"
JBOSS_LOG_DIR="{{ wildfly_log_dir }}"

# Need to modify the init script to account for JBOSS_OPTS
# Allows us to pass system properties to WildFly
Expand Down
3 changes: 3 additions & 0 deletions templates/wildfly.properties.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ jboss.http.port={{ wildfly_http_port }}
jboss.https.port={{ wildfly_https_port }}
jboss.bind.address.management={{ wildfly_management_bind_address }}
jboss.server.temp.dir={{ wildfly_temp_dir }}
jboss.boot.log.file={{ wildfly_boot_log }}
jboss.server.log.file={{ wildfly_server_log }}
jboss.server.log.dir={{ wildfly_server_log_dir }}
{% if wildfly_node_name %}
jboss.node.name={{ wildfly_node_name }}
{% endif %}
Expand Down

0 comments on commit 482e95e

Please sign in to comment.