Skip to content

Commit 936a0ca

Browse files
authored
Merge pull request #247 from hpuhr/v0.7.1_fixes
V0.7.1 fixes
2 parents 7cad401 + ec594b3 commit 936a0ca

File tree

98 files changed

+1592
-951
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+1592
-951
lines changed

conf/default/db_content.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
{
22
"parameters": {
3-
"limit_max": 1000000,
4-
"limit_min": 0,
5-
"max_live_data_age": 10,
6-
"order_variable_dbcontent_name": "Meta",
7-
"order_variable_name": "Timestamp",
83
"use_filters": false,
9-
"use_limit": false,
10-
"use_order": true,
11-
"use_order_ascending": true
4+
"use_limit": false
125
},
136
"sub_config_files": [
147
{

data/icons/right.png

6.85 KB
Loading

doc/user_manual/appendix/appendix.tex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ \chapter{Appendix}
77

88
\subfile {appendix_view_points}
99

10+
\subfile {appendix_maps}
11+
1012
\subfile {appendix_algorithms}
1113

14+
\subfile {appendix_logging}
15+
1216
\subfile {appendix_latex}
1317

1418
\subfile {appendix_utils}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
\section{Appendix: Logging}
2+
\label{sec:appendix_logging}
3+
4+
Logging in COMPASS is performed using the log4cpp library (see \href{https://log4cpp.sourceforge.net/}{Link}). At startup of the application, the logging behaviour is defined using a log4cpp.properties file (located in the configuration folder).
5+
6+
A default file is defined as follows:
7+
\begin{lstlisting}
8+
# log4cpp.properties
9+
10+
log4cpp.rootCategory=DEBUG, consoleAppender #, fileAppender
11+
#log4cpp.category.sub1=INFO, A1, A2
12+
#log4cpp.category.sub1.sub2=INFO, A3
13+
14+
log4cpp.appender.consoleAppender=ConsoleAppender
15+
log4cpp.appender.consoleAppender.layout=PatternLayout
16+
log4cpp.appender.consoleAppender.layout.ConversionPattern=[%p] %m%n
17+
#log4cpp.appender.consoleAppender.layout.ConversionPattern=%d [%p] %m%n
18+
19+
#log4cpp.appender.fileAppender=FileAppender
20+
#log4cpp.appender.fileAppender.fileName=log.txt
21+
#log4cpp.appender.fileAppender.layout=PatternLayout
22+
23+
#log4cpp.appender.A2=FileAppender
24+
#log4cpp.appender.A2.threshold=WARN
25+
#log4cpp.appender.A2.fileName=A2.log
26+
#log4cpp.appender.A2.layout=PatternLayout
27+
#log4cpp.appender.A2.layout.ConversionPattern=%d [%p] %m%n
28+
29+
#log4cpp.appender.A3=RollingFileAppender
30+
#log4cpp.appender.A3.fileName=A3.log
31+
#log4cpp.appender.A3.maxFileSize=200
32+
#log4cpp.appender.A3.maxBackupIndex=1
33+
#log4cpp.appender.A3.layout=PatternLayout
34+
#log4cpp.appender.A3.layout.ConversionPattern=%d [%p] %m%n
35+
\end{lstlisting}
36+
37+
Per default, only a console-log is defined.
38+
39+
\subsection{Log Formatting}
40+
The format of the log message can be changed using the 'ConversionPattern' setting, the following contents are possible:
41+
\begin{lstlisting}
42+
%% - a single percent sign
43+
%c - the category
44+
%d - the date\n Date format: The date format character may be followed by a date format specifier enclosed between braces. For example, %d{%H:%M:%S,%l} or %d{%d %m %Y %H:%M:%S,%l}. If no date format specifier is given then the following format is used: "Wed Jan 02 02:03:55 1980". The date format specifier admits the same syntax as the ANSI C function strftime, with 1 addition. The addition is the specifier %l for milliseconds, padded with zeros to make 3 digits.
45+
%m - the message
46+
%n - the platform specific line separator
47+
%p - the priority
48+
%r - milliseconds since this layout was created.
49+
%R - seconds since Jan 1, 1970
50+
%u - clock ticks since process start
51+
%x - the NDC
52+
\end{lstlisting}
53+
54+
A common setting to include date and timing information would be:
55+
56+
\begin{lstlisting}
57+
...
58+
log4cpp.appender.consoleAppender.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%l} [%p] %m%n
59+
...
60+
\end{lstlisting}
61+
62+
which would result in log messages like:
63+
\begin{lstlisting}
64+
2023-01-10 14:16:58.085 [INFO] SQLiteConnection: constructor: SQLITE_VERSION 3.37.2
65+
\end{lstlisting}
66+
67+
68+
\subsection{Log File}
69+
70+
To (additionally to the console log) create a log 'compass\_log.txt' file, the log4cpp.properties file can be changed as follows:
71+
72+
\begin{lstlisting}
73+
# log4cpp.properties
74+
75+
log4cpp.rootCategory=DEBUG, consoleAppender, fileAppender
76+
77+
log4cpp.appender.consoleAppender=ConsoleAppender
78+
log4cpp.appender.consoleAppender.layout=PatternLayout
79+
log4cpp.appender.consoleAppender.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%l} [%p] %m%n
80+
81+
log4cpp.appender.fileAppender=FileAppender
82+
log4cpp.appender.fileAppender.fileName=compass_log.txt
83+
log4cpp.appender.fileAppender.layout=PatternLayout
84+
log4cpp.appender.fileAppender.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%l} [%p] %m%n
85+
\end{lstlisting}
86+
87+
The log4cpp library always appends to created log files in when using FileAppender's.
88+
89+
90+
\subsection{Rotating Log File}
91+
\label{sec:appendix_logging_rotate}
92+
93+
To (additionally to the console log) create a rotating log (for 24h operation), the log4cpp.properties file can be changed as in the following example. Also, a log file with all warnings (and errors) was added.
94+
95+
\begin{lstlisting}
96+
# log4cpp.properties
97+
98+
log4cpp.rootCategory=DEBUG, consoleAppender, warningFileAppender, rollingFileAppender
99+
100+
log4cpp.appender.consoleAppender=ConsoleAppender
101+
log4cpp.appender.consoleAppender.layout=PatternLayout
102+
log4cpp.appender.consoleAppender.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%l} [%p] %m%n
103+
104+
log4cpp.appender.warningFileAppender=FileAppender
105+
log4cpp.appender.warningFileAppender.fileName=compass_warn_log.txt
106+
log4cpp.appender.warningFileAppender.threshold=WARN
107+
log4cpp.appender.warningFileAppender.layout=PatternLayout
108+
log4cpp.appender.warningFileAppender.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%l} [%p] %m%n
109+
110+
log4cpp.appender.rollingFileAppender=RollingFileAppender
111+
log4cpp.appender.rollingFileAppender.fileName=compass_log.txt
112+
log4cpp.appender.rollingFileAppender.maxFileSize=100000000
113+
log4cpp.appender.rollingFileAppender.maxBackupIndex=5
114+
log4cpp.appender.rollingFileAppender.layout=PatternLayout
115+
log4cpp.appender.rollingFileAppender.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%l} [%p] %m%n
116+
\end{lstlisting}
117+
118+
The maxFileSize is the maximumum file size in bytes (100 MB in example) after which a new file will be created, of which only maxBackupIndex (5) can exist and are used in rotation.

0 commit comments

Comments
 (0)