VOL-385: Adjust voltha log level per running environment. Create specific files for production and for jenkins
Change-Id: I4abc75a7dc9362840e7563235a89cb78dfa4fe52
diff --git a/Jenkinsfile b/Jenkinsfile
index 725a38e..2ef8476 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -10,6 +10,9 @@
stage 'Remove the pre-created venv-linux'
sh 'vagrant ssh -c "rm -rf /cord/incubator/voltha/venv-linux"'
+ stage 'Use the jenkins voltha.yml file'
+ sh 'vagrant ssh -c "cp /cord/incubator/voltha/voltha/voltha.jenkins.yml /cord/incubator/voltha/voltha/voltha.yml"'
+
stage 'Build voltha'
sh 'vagrant ssh -c "cd /cord/incubator/voltha && source env.sh && make fetch-jenkins && make jenkins" voltha'
diff --git a/voltha/voltha.jenkins.yml b/voltha/voltha.jenkins.yml
new file mode 100644
index 0000000..98c80e3
--- /dev/null
+++ b/voltha/voltha.jenkins.yml
@@ -0,0 +1,90 @@
+logging:
+ version: 1
+
+ formatters:
+ brief:
+ format: '%(message)s'
+ default:
+ format: '%(asctime)s.%(msecs)03d %(levelname)-8s %(threadName)s %(module)s.%(funcName)s %(message)s'
+ datefmt: '%Y%m%dT%H%M%S'
+ fluent_fmt:
+ '()': fluent.handler.FluentRecordFormatter
+ format:
+ level: '%(levelname)s'
+ hostname: '%(hostname)s'
+ where: '%(module)s.%(funcName)s'
+
+ handlers:
+ console:
+ class : logging.StreamHandler
+ level: DEBUG
+ formatter: default
+ stream: ext://sys.stdout
+ fluent:
+ class: fluent.handler.FluentHandler
+ host: localhost
+ port: 24224
+ tag: voltha.logging
+ formatter: fluent_fmt
+ level: DEBUG
+ localRotatingFile:
+ class: logging.handlers.RotatingFileHandler
+ filename: voltha.log
+ formatter: default
+ maxBytes: 2097152
+ backupCount: 10
+ level: DEBUG
+ null:
+ class: logging.NullHandler
+
+ loggers:
+ amqp:
+ handlers: [null]
+ propagate: False
+ conf:
+ handlers: [null]
+ propagate: False
+ '': # root logger
+ handlers: [console, fluent, localRotatingFile]
+ level: INFO # this can be bumped up/down by -q and -v command line
+ # options
+ propagate: False
+
+core:
+ management_vlan: 4091
+
+coordinator:
+ voltha_kv_prefix: 'service/voltha'
+ core_store_key: 'data/core'
+ leader_key: 'leader'
+ membership_key: 'members'
+ assignment_key: 'assignments'
+ workload_key: 'work'
+ membership_watch_relatch_delay: 0.1
+ membership_maintenance_loop_delay: 5
+ tracking_loop_delay: 1
+ session_time_to_live: 60
+ session_renewal_loop_delay: 10
+ session_renewal_timeout: 10
+
+worker:
+ time_to_let_leader_update: 5
+ assignments_track_error_to_avoid_flood: 1
+
+leader:
+ workload_track_error_to_prevent_flood: 1
+ members_track_error_to_prevent_flood: 1
+
+kafka-proxy:
+ event_bus_publisher:
+ topic_mappings:
+ 'model-change-events':
+ kafka_topic: 'voltha.events'
+ filters: [null]
+ 'alarms':
+ kafka_topic: 'voltha.alarms'
+ filters: [null]
+ 'kpis':
+ kafka_topic: 'voltha.kpis'
+ filters: [null]
+
diff --git a/voltha/voltha.production.yml b/voltha/voltha.production.yml
new file mode 100644
index 0000000..254acc8
--- /dev/null
+++ b/voltha/voltha.production.yml
@@ -0,0 +1,78 @@
+logging:
+ version: 1
+
+ formatters:
+ brief:
+ format: '%(message)s'
+ default:
+ format: '%(asctime)s.%(msecs)03d %(levelname)-8s %(threadName)s %(module)s.%(funcName)s %(message)s'
+ datefmt: '%Y%m%dT%H%M%S'
+ fluent_fmt:
+ '()': fluent.handler.FluentRecordFormatter
+ format:
+ level: '%(levelname)s'
+ hostname: '%(hostname)s'
+ where: '%(module)s.%(funcName)s'
+
+ handlers:
+ fluent:
+ class: fluent.handler.FluentHandler
+ host: localhost
+ port: 24224
+ tag: voltha.logging
+ formatter: fluent_fmt
+ level: INFO
+ null:
+ class: logging.NullHandler
+
+ loggers:
+ amqp:
+ handlers: [null]
+ propagate: False
+ conf:
+ handlers: [null]
+ propagate: False
+ '': # root logger
+ handlers: [fluent]
+ level: INFO # this can be bumped up/down by -q and -v command line
+ # options
+ propagate: False
+
+core:
+ management_vlan: 4091
+
+coordinator:
+ voltha_kv_prefix: 'service/voltha'
+ core_store_key: 'data/core'
+ leader_key: 'leader'
+ membership_key: 'members'
+ assignment_key: 'assignments'
+ workload_key: 'work'
+ membership_watch_relatch_delay: 0.1
+ membership_maintenance_loop_delay: 5
+ tracking_loop_delay: 1
+ session_time_to_live: 60
+ session_renewal_loop_delay: 10
+ session_renewal_timeout: 10
+
+worker:
+ time_to_let_leader_update: 5
+ assignments_track_error_to_avoid_flood: 1
+
+leader:
+ workload_track_error_to_prevent_flood: 1
+ members_track_error_to_prevent_flood: 1
+
+kafka-proxy:
+ event_bus_publisher:
+ topic_mappings:
+ 'model-change-events':
+ kafka_topic: 'voltha.events'
+ filters: [null]
+ 'alarms':
+ kafka_topic: 'voltha.alarms'
+ filters: [null]
+ 'kpis':
+ kafka_topic: 'voltha.kpis'
+ filters: [null]
+
diff --git a/voltha/voltha.yml b/voltha/voltha.yml
index 88c0b9f..98c80e3 100644
--- a/voltha/voltha.yml
+++ b/voltha/voltha.yml
@@ -17,7 +17,7 @@
handlers:
console:
class : logging.StreamHandler
- level: INFO
+ level: DEBUG
formatter: default
stream: ext://sys.stdout
fluent:
@@ -26,14 +26,14 @@
port: 24224
tag: voltha.logging
formatter: fluent_fmt
- level: INFO
+ level: DEBUG
localRotatingFile:
class: logging.handlers.RotatingFileHandler
filename: voltha.log
formatter: default
maxBytes: 2097152
backupCount: 10
- level: INFO
+ level: DEBUG
null:
class: logging.NullHandler