Skip to content

Commit

Permalink
Change: Log to stderr, new log file build option.
Browse files Browse the repository at this point in the history
Now the log messages are logged to stderr by default. The log file
for the generated gsad_log.conf can now be set by a new build option
GSAD_LOG_FILE.
  • Loading branch information
jhelmold committed Oct 21, 2024
1 parent 850e6fb commit 3114cff
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,16 @@ else (NOT GVM_STATE_DIR)
set (GVM_STATE_DIR "${GVM_STATE_DIR}")
endif (NOT GVM_STATE_DIR)

if (NOT GVM_LOG_DIR)
set (GVM_LOG_DIR "${LOCALSTATEDIR}/log/gvm")
else (NOT GVM_LOG_DIR)
set (GVM_LOG_DIR "${GVM_LOG_DIR}")
endif (NOT GVM_LOG_DIR)
if (NOT GSAD_LOG_FILE)
if (GVM_LOG_DIR)
set (GSAD_LOG_FILE "${GVM_LOG_DIR}/gsad.log")
else (GVM_LOG_DIR)
set (GSAD_LOG_FILE "-")
endif (GVM_LOG_DIR)
else (NOT GSAD_LOG_FILE)
set (GSAD_LOG_FILE "${GSAD_LOG_FILE}")
endif (NOT GSAD_LOG_FILE)
message ("-- Log file: ${GSAD_LOG_FILE}")

if (NOT GVM_SERVER_CERTIFICATE)
set (GVM_SERVER_CERTIFICATE "${GVM_STATE_DIR}/CA/servercert.pem")
Expand Down
12 changes: 6 additions & 6 deletions src/gsad_log_conf.cmake_in
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,40 @@
prepend=%t %s %p
separator=:
prepend_time_format=%Y-%m-%d %Hh%M.%S %Z
file=${GVM_LOG_DIR}/gsad.log
file=${GSAD_LOG_FILE}
level=127

[gsad gmp]
prepend=%t %s %p
separator=:
prepend_time_format=%Y-%m-%d %Hh%M.%S %Z
file=${GVM_LOG_DIR}/gsad.log
file=${GSAD_LOG_FILE}
level=127

[gsad i18n]
prepend=%t %s %p
separator=:
prepend_time_format=%Y-%m-%d %Hh%M.%S %Z
file=${GVM_LOG_DIR}/gsad.log
file=${GSAD_LOG_FILE}
level=127

[gsad http]
prepend=%t %s %p
separator=:
prepend_time_format=%Y-%m-%d %Hh%M.%S %Z
file=${GVM_LOG_DIR}/gsad.log
file=${GSAD_LOG_FILE}
level=127

[gsad vali]
prepend=%t %s %p
separator=:
prepend_time_format=%Y-%m-%d %Hh%M.%S %Z
file=${GVM_LOG_DIR}/gsad.log
file=${GSAD_LOG_FILE}
level=127

[*]
prepend=%t %s %p
separator=:
prepend_time_format=%Y-%m-%d %Hh%M.%S %Z
file=${GVM_LOG_DIR}/gsad.log
file=${GSAD_LOG_FILE}
level=0

0 comments on commit 3114cff

Please sign in to comment.