Skip to content

Commit

Permalink
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 gvmd_log.conf can now be set by a new build option
GVMD_LOG_FILE.
  • Loading branch information
jhelmold committed Oct 21, 2024
1 parent 88cdf82 commit 5446f1b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,15 @@ if (NOT GVMD_STATE_DIR)
set (GVMD_STATE_DIR "${GVM_STATE_DIR}/gvmd")
endif (NOT GVMD_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 GVMD_LOG_FILE)
if (GVM_LOG_DIR)
set (GVMD_LOG_FILE "${GVM_LOG_DIR}/gvmd.log")
else (GVM_LOG_DIR)
set (GVMD_LOG_FILE "-")
endif (GVMD_LOG_DIR)
else (NOT GVMD_LOG_FILE)
set (GVMD_LOG_FILE "${GVMD_LOG_FILE}")
endif (NOT GVMD_LOG_FILE)

set (GVM_SCAP_RES_DIR "${GVM_DATA_DIR}/scap")
set (GVM_CERT_RES_DIR "${GVM_DATA_DIR}/cert")
Expand Down Expand Up @@ -253,6 +257,7 @@ endif (NOT COMPLIANCE_REPORTS)
add_definitions (-DCOMPLIANCE_REPORTS=${COMPLIANCE_REPORTS})

message ("-- Install prefix: ${CMAKE_INSTALL_PREFIX}")
message ("-- Log file: ${GVMD_LOG_FILE}")

## Version

Expand Down
20 changes: 10 additions & 10 deletions src/gvmd_log_conf.cmake_in
Original file line number Diff line number Diff line change
Expand Up @@ -7,63 +7,63 @@
prepend=%t %s %p
separator=:
prepend_time_format=%Y-%m-%d %Hh%M.%S %Z
file=${GVM_LOG_DIR}/gvmd.log
file=${GVMD_LOG_FILE}
level=127

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

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

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

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

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

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

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

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

[event syslog]
Expand All @@ -86,5 +86,5 @@ level=128
prepend=%t %s %p
separator=:
prepend_time_format=%Y-%m-%d %Hh%M.%S %Z
file=${GVM_LOG_DIR}/gvmd.log
file=${GVMD_LOG_FILE}
level=127

0 comments on commit 5446f1b

Please sign in to comment.