From 4090b246b69f55736f5c5adb4ef5ddcee9fd9340 Mon Sep 17 00:00:00 2001
From: Arno Schoenmakers <schoenmakers@astron.nl>
Date: Fri, 25 May 2018 10:32:27 +0000
Subject: [PATCH] SW-356: Adding log_prop for beamctl as well (thanks Auke!)

---
 .gitattributes                                |  1 +
 MAC/APL/PAC/ITRFBeamServer/src/CMakeLists.txt |  3 ++
 .../PAC/ITRFBeamServer/src/beamctl.log_prop   | 48 +++++++++++++++++++
 3 files changed, 52 insertions(+)
 create mode 100644 MAC/APL/PAC/ITRFBeamServer/src/beamctl.log_prop

diff --git a/.gitattributes b/.gitattributes
index 32cbcb14997..2e7c173434e 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2285,6 +2285,7 @@ MAC/APL/PAC/ICAL_Protocol/src/SpectralWindow.cc -text
 MAC/APL/PAC/ICAL_Protocol/src/SubArray.cc -text
 MAC/APL/PAC/ITRFBeamServer/src/StatCal.cc -text
 MAC/APL/PAC/ITRFBeamServer/src/StatCal.h -text
+MAC/APL/PAC/ITRFBeamServer/src/beamctl.log_prop -text
 MAC/APL/PAC/ITRFBeamServer/src/iBeamServer.conf.in -text
 MAC/APL/PAC/ITRFBeamServer/src/ibeamctl.conf.in -text
 MAC/APL/PAC/ITRFBeamServer/test/AntennaField.conf -text
diff --git a/MAC/APL/PAC/ITRFBeamServer/src/CMakeLists.txt b/MAC/APL/PAC/ITRFBeamServer/src/CMakeLists.txt
index 45bf2de6d4f..e3e6453a0ea 100644
--- a/MAC/APL/PAC/ITRFBeamServer/src/CMakeLists.txt
+++ b/MAC/APL/PAC/ITRFBeamServer/src/CMakeLists.txt
@@ -25,3 +25,6 @@ install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/BeamServer.conf
   ${CMAKE_CURRENT_BINARY_DIR}/beamctl.conf
   DESTINATION etc)
+
+lofar_add_sysconf_files(beamctl.log_prop)
+
diff --git a/MAC/APL/PAC/ITRFBeamServer/src/beamctl.log_prop b/MAC/APL/PAC/ITRFBeamServer/src/beamctl.log_prop
new file mode 100644
index 00000000000..ca21a4aff12
--- /dev/null
+++ b/MAC/APL/PAC/ITRFBeamServer/src/beamctl.log_prop
@@ -0,0 +1,48 @@
+# 
+# Adapted log_prop file for beamctl. All runs of beamctl will add logging to 
+# an existing Rolling logfile, instead of creating a new one each run.
+# As the buffer was limited, many older files were overwritten which
+# made debugging or finding out what happened in case of a problem impossible. 
+#
+# setup the right levels for logging and tracing
+#
+# Note: In production you don't want to loose any information so a daily rolling-file
+#       is used and tracing is switched off.
+#       For debugging purposes the daily rolling-file becomes too large so a size-based
+#       rolling file is used and tracing is switched on.
+# 
+# Please do not change the logger lines below, only comment them in or out.
+
+# For PRODUCTION:
+# - Select the appropriate log-level for the rootLogger (DEBUG or INFO)
+# - Leave the TRC logger on DEBUG,DUMP
+# - Comment out the rootLogger and the TRC logger in the TEST section of this file
+#log4cplus.rootLogger=DEBUG, DAILYFILE
+log4cplus.rootLogger=INFO, ROLFILE
+log4cplus.logger.TRC=DEBUG, DUMP
+
+# For TESTING:
+# - Select the appropriate trace level for the TRC logger
+# - Leave the rootLogger on DEBUG, ROLFILE
+# - Comment out the rootLogger and the TRC logger in the PRODUCTION section of this file
+#log4cplus.rootLogger=DEBUG,  ROLFILE
+#log4cplus.logger.TRC=TRACE5, ROLFILE
+
+
+# The next line should always be active.
+log4cplus.additivity.TRC=FALSE
+
+# Definitions of the output channels
+log4cplus.appender.STDOUT=log4cplus::ConsoleAppender
+log4cplus.appender.STDOUT.layout=log4cplus::PatternLayout
+log4cplus.appender.STDOUT.layout.ConversionPattern=%D{%Y-%m-%d %H:%M:%S.%q} %-5p %c{3} - %m [%.25l]%n
+
+log4cplus.appender.ROLFILE=log4cplus::RollingFileAppender
+log4cplus.appender.ROLFILE.File=${LOFARROOT}/var/log/${LOG4CPLUS_LOGFILENAME}.log
+log4cplus.appender.ROLFILE.MaxFileSize=100MB
+log4cplus.appender.ROLFILE.MaxBackupIndex=999
+log4cplus.appender.ROLFILE.layout=log4cplus::PatternLayout
+log4cplus.appender.ROLFILE.layout.ConversionPattern=%x %D{%Y-%m-%d %H:%M:%S.%q} %-5p %c{3} - %m [%.25l]%n
+
+log4cplus.appender.DUMP=log4cplus::NullAppender
+
-- 
GitLab