Moving log file out of distribution directory
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/af6ca9a7 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/af6ca9a7 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/af6ca9a7 Branch: refs/heads/develop Commit: af6ca9a78f9a39f2e3506ebf5673daedacc1700d Parents: e74625d Author: Marcus Christie <[email protected]> Authored: Tue Apr 25 11:16:57 2017 -0400 Committer: Marcus Christie <[email protected]> Committed: Tue Apr 25 14:52:58 2017 -0400 ---------------------------------------------------------------------- .../scigap/production/group_vars/all/vars.yml | 2 + .../ansible/roles/api-orch/defaults/main.yml | 1 + dev-tools/ansible/roles/api-orch/tasks/main.yml | 9 +++- .../roles/api-orch/templates/logback.xml.j2 | 55 ++++++++++++++++++++ dev-tools/ansible/roles/gfac/defaults/main.yml | 21 ++++++++ dev-tools/ansible/roles/gfac/tasks/main.yml | 9 +++- .../ansible/roles/gfac/templates/logback.xml.j2 | 55 ++++++++++++++++++++ 7 files changed, 150 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/af6ca9a7/dev-tools/ansible/inventories/scigap/production/group_vars/all/vars.yml ---------------------------------------------------------------------- diff --git a/dev-tools/ansible/inventories/scigap/production/group_vars/all/vars.yml b/dev-tools/ansible/inventories/scigap/production/group_vars/all/vars.yml index 3984024..da3a545 100644 --- a/dev-tools/ansible/inventories/scigap/production/group_vars/all/vars.yml +++ b/dev-tools/ansible/inventories/scigap/production/group_vars/all/vars.yml @@ -76,6 +76,7 @@ orchestrator_name: "orchestrator-node0" orchestrator_host: "{{ groups['api-orch'][0] }}" orchestrator_port: "8940" api_orch_dir: "{{ deployment_dir }}/api-orchestrator" +api_orch_log_dir: "{{ api_orch_dir }}/logs" # registry related variables registry_name: regserver-node0 @@ -103,6 +104,7 @@ gfac_name: "gfac-node0" gfac_host: "{{ groups['gfac'][0] }}" gfac_port: "8950" gfac_dir: "{{ deployment_dir }}/gfac-instance" +gfac_log_dir: "{{ gfac_dir }}/logs" # Monitoring variables monitor_email_address: "[email protected]" http://git-wip-us.apache.org/repos/asf/airavata/blob/af6ca9a7/dev-tools/ansible/roles/api-orch/defaults/main.yml ---------------------------------------------------------------------- diff --git a/dev-tools/ansible/roles/api-orch/defaults/main.yml b/dev-tools/ansible/roles/api-orch/defaults/main.yml index eb74160..c7dd3a9 100644 --- a/dev-tools/ansible/roles/api-orch/defaults/main.yml +++ b/dev-tools/ansible/roles/api-orch/defaults/main.yml @@ -19,3 +19,4 @@ # api_orch_server_names: "api-orch" +api_orch_log_dir: "../logs" http://git-wip-us.apache.org/repos/asf/airavata/blob/af6ca9a7/dev-tools/ansible/roles/api-orch/tasks/main.yml ---------------------------------------------------------------------- diff --git a/dev-tools/ansible/roles/api-orch/tasks/main.yml b/dev-tools/ansible/roles/api-orch/tasks/main.yml index 1a5b298..da8e313 100644 --- a/dev-tools/ansible/roles/api-orch/tasks/main.yml +++ b/dev-tools/ansible/roles/api-orch/tasks/main.yml @@ -66,6 +66,13 @@ group={{ group }} mode="u=rw,g=r,o=r" +- name: Copy logback configuration file + template: src=logback.xml.j2 + dest="{{ api_orch_dir }}/{{ airavata_dist }}/bin/logback.xml" + owner={{ user }} + group={{ group }} + mode="u=rw,g=r,o=r" + - name: Copy Mysql jar to lib copy: src={{ mysql_connector_jar }} dest="{{ api_orch_dir }}/{{ airavata_dist }}/lib/{{ mysql_connector_jar }}" @@ -88,7 +95,7 @@ removes="{{ api_orch_dir }}/{{ airavata_dist }}/bin/server_start_*" - name: start api-orch - command: ./bin/airavata-server-start.sh api-orch -d + command: ./bin/airavata-server-start.sh api-orch -d -log "{{ api_orch_log_dir }}/output.log" chdir="{{ api_orch_dir }}/{{ airavata_dist }}/" creates="{{ api_orch_dir }}/{{ airavata_dist }}/bin/server_start_*" http://git-wip-us.apache.org/repos/asf/airavata/blob/af6ca9a7/dev-tools/ansible/roles/api-orch/templates/logback.xml.j2 ---------------------------------------------------------------------- diff --git a/dev-tools/ansible/roles/api-orch/templates/logback.xml.j2 b/dev-tools/ansible/roles/api-orch/templates/logback.xml.j2 new file mode 100644 index 0000000..d66170e --- /dev/null +++ b/dev-tools/ansible/roles/api-orch/templates/logback.xml.j2 @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +--> +<configuration> + <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>[%p] %m%n</pattern> + </encoder> + </appender> + <appender name="LOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <!--See http://logback.qos.ch/manual/appenders.html#RollingFileAppender--> + <!--and http://logback.qos.ch/manual/appenders.html#TimeBasedRollingPolicy--> + <!--for further documentation--> + <File>{{ api_orch_log_dir }}/airavata.log</File> + <Append>true</Append> + <encoder> + <pattern>%d [%t] %-5p %c{30} %X - %m%n</pattern> + </encoder> + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> + <fileNamePattern>{{ api_orch_log_dir }}/airavata.log.%d{yyyy-MM-dd}</fileNamePattern> + </rollingPolicy> + </appender> + <logger name="org.apache.zookeeper" level="ERROR"/> + <logger name="edu.internet2.middleware.grouper" level="ERROR"/> + <logger name="org.globus" level="INFO"/> + <logger name="org.apache.commons.httpclient" level="ERROR"/> + <logger name="org.apache.airavata" level="INFO"/> + <logger name="org.hibernate" level="ERROR"/> + <logger name="de.hunsicker.jalopy.io" level="ERROR"/> + <logger name="httpclient.wire.header" level="ERROR"/> + <logger name="org.apache.axis2.enterprise" level="ERROR"/> + <root level="INFO"> + <appender-ref ref="CONSOLE"/> + <appender-ref ref="LOGFILE"/> + </root> +</configuration> http://git-wip-us.apache.org/repos/asf/airavata/blob/af6ca9a7/dev-tools/ansible/roles/gfac/defaults/main.yml ---------------------------------------------------------------------- diff --git a/dev-tools/ansible/roles/gfac/defaults/main.yml b/dev-tools/ansible/roles/gfac/defaults/main.yml new file mode 100644 index 0000000..c7ccc3d --- /dev/null +++ b/dev-tools/ansible/roles/gfac/defaults/main.yml @@ -0,0 +1,21 @@ +# +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +gfac_log_dir: "../logs" http://git-wip-us.apache.org/repos/asf/airavata/blob/af6ca9a7/dev-tools/ansible/roles/gfac/tasks/main.yml ---------------------------------------------------------------------- diff --git a/dev-tools/ansible/roles/gfac/tasks/main.yml b/dev-tools/ansible/roles/gfac/tasks/main.yml index d5de2c6..31e486a 100644 --- a/dev-tools/ansible/roles/gfac/tasks/main.yml +++ b/dev-tools/ansible/roles/gfac/tasks/main.yml @@ -62,6 +62,13 @@ group={{ group }} mode="u=rw,g=r,o=r" +- name: Copy logback configuration file + template: src=logback.xml.j2 + dest="{{ gfac_dir }}/{{ airavata_dist }}/bin/logback.xml" + owner={{ user }} + group={{ group }} + mode="u=rw,g=r,o=r" + - name: Copy Mysql jar to lib copy: src="{{ mysql_connector_jar }}" dest="{{ gfac_dir }}/{{ airavata_dist }}/lib/{{ mysql_connector_jar }}" @@ -79,7 +86,7 @@ removes="{{ gfac_dir }}/{{ airavata_dist }}/bin/server_start_*" - name: start gfac - command: ./bin/airavata-server-start.sh gfac -d + command: ./bin/airavata-server-start.sh gfac -d -log "{{ gfac_log_dir }}/output.log" chdir="{{ gfac_dir }}/{{ airavata_dist }}/" creates="{{ gfac_dir }}/{{ airavata_dist }}/bin/server_start_*" http://git-wip-us.apache.org/repos/asf/airavata/blob/af6ca9a7/dev-tools/ansible/roles/gfac/templates/logback.xml.j2 ---------------------------------------------------------------------- diff --git a/dev-tools/ansible/roles/gfac/templates/logback.xml.j2 b/dev-tools/ansible/roles/gfac/templates/logback.xml.j2 new file mode 100644 index 0000000..81b4929 --- /dev/null +++ b/dev-tools/ansible/roles/gfac/templates/logback.xml.j2 @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +--> +<configuration> + <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>[%p] %m%n</pattern> + </encoder> + </appender> + <appender name="LOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <!--See http://logback.qos.ch/manual/appenders.html#RollingFileAppender--> + <!--and http://logback.qos.ch/manual/appenders.html#TimeBasedRollingPolicy--> + <!--for further documentation--> + <File>{{ gfac_log_dir }}/airavata.log</File> + <Append>true</Append> + <encoder> + <pattern>%d [%t] %-5p %c{30} %X - %m%n</pattern> + </encoder> + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> + <fileNamePattern>{{ gfac_log_dir }}/airavata.log.%d{yyyy-MM-dd}</fileNamePattern> + </rollingPolicy> + </appender> + <logger name="org.apache.zookeeper" level="ERROR"/> + <logger name="edu.internet2.middleware.grouper" level="ERROR"/> + <logger name="org.globus" level="INFO"/> + <logger name="org.apache.commons.httpclient" level="ERROR"/> + <logger name="org.apache.airavata" level="INFO"/> + <logger name="org.hibernate" level="ERROR"/> + <logger name="de.hunsicker.jalopy.io" level="ERROR"/> + <logger name="httpclient.wire.header" level="ERROR"/> + <logger name="org.apache.axis2.enterprise" level="ERROR"/> + <root level="INFO"> + <appender-ref ref="CONSOLE"/> + <appender-ref ref="LOGFILE"/> + </root> +</configuration>
