Support Support Downloads Knowledge Base Case Manager My Juniper Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[Contrail] Customized logging on contrail vrouters



Article ID: KB36389 KB Last Updated: 26 Dec 2020Version: 1.0

This article explains how to make customized logging for contrail-vrouter-agent log files. This is required when default logging does not yield enough information for troubleshooting.


There can be troubleshooting scenarios where contrail-vrouter-agent log files are needed for a longer duration of time. At the same time, the number of files are also needed to be rotated. This procedure is tested for CEN-3.X and CEN-4.X.


Below is the configuration which is needed to modify in contrail-vrouter-agent.conf. The modification is for the size of file, number of files which needs be rotated and the severity of logging.

contrail-vrouter-agent.conf file with additional log file parameters:

log_file <defines location of log file>
log_file_size <defines size of log file after which log file will be rotated, the value is in bytes>
log_files_count <number of log files which will be kept>
log_level <log severity level modify it to SYS_DEBUG or other desired log severity>

root@compute:~# cat /etc/contrail/contrail-vrouter-agent.conf 
# Vnswad configuration options

servers =
# List of IPAdress:Port of control-node's separated by space.(Mandatory)
# servers=

# Everything in this section is optional

# IP address and port to be used to connect to collector.
# Multiple IP:port strings separated by space can be provided
# collectors=

# Agent mode : can be vrouter / tsn / tsn-no-forwarding / tor (default is vrouter)
# agent_mode=

# Aging time for flow-records in seconds
# flow_cache_timeout=0

# hostname= # Retrieved from gethostname() or `hostname -s` equivalent

# Http server port for inspecting vnswad state (useful for debugging)
# http_server_port=8085

# Category for logging. Default value is '*'
# log_category=

# Number of tx-buffers on pkt0 interface
# pkt0_tx_buffers=1000
# Measure delays in different queues
# measure_queue_delay=0
# Local log file name

# Log severity levels. Possible values are SYS_EMERG, SYS_ALERT, SYS_CRIT,

restart vrouter-agent:

root@compute:~# service contrail-vrouter-agent restart

10 log files with configured size are rotated for vrouter-agent:

root@compute:~# ls -lah /var/log/contrail/contrail-vrouter-a*
-rw-r--r-- 1 root root  70K Dec 16 21:59 /var/log/contrail/contrail-vrouter-agent.log
-rw-r--r-- 1 root root 201K Dec 16 21:37 /var/log/contrail/contrail-vrouter-agent.log.1
-rw-r--r-- 1 root root 201K Dec 16 14:35 /var/log/contrail/contrail-vrouter-agent.log.10
-rw-r--r-- 1 root root 201K Dec 16 20:35 /var/log/contrail/contrail-vrouter-agent.log.2
-rw-r--r-- 1 root root 201K Dec 16 19:33 /var/log/contrail/contrail-vrouter-agent.log.3
-rw-r--r-- 1 root root 201K Dec 16 18:31 /var/log/contrail/contrail-vrouter-agent.log.4
-rw-r--r-- 1 root root 201K Dec 16 17:29 /var/log/contrail/contrail-vrouter-agent.log.5
-rw-r--r-- 1 root root 201K Dec 16 16:27 /var/log/contrail/contrail-vrouter-agent.log.6
-rw-r--r-- 1 root root 201K Dec 16 15:25 /var/log/contrail/contrail-vrouter-agent.log.7
-rw-r--r-- 1 root root 201K Dec 16 14:35 /var/log/contrail/contrail-vrouter-agent.log.8
-rw-r--r-- 1 root root 201K Dec 16 14:35 /var/log/contrail/contrail-vrouter-agent.log.9

Debug level logs are also printed:

root@compute:~# grep -i debug /var/log/contrail/contrail-vrouter-agent.log* | head -n 2
/var/log/contrail/contrail-vrouter-agent.log.10:2020-12-16 Wed 14:35:09:621.161 EST  compute [Thread 139850072151808, Pid 112721]: TCP [SYS_DEBUG]: TcpServerMessageLog: Server  Initialization complete controller/src/io/ 120
/var/log/contrail/contrail-vrouter-agent.log.10:2020-12-16 Wed 14:35:09:621.814 EST  compute [Thread 139850234464128, Pid 112721]: TCP [SYS_DEBUG]: TcpSessionMessageLog: Session < Active session connection complete controller/src/io/ 289
Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search