English | Deutsch
Home »

OpenVAS Change Request #29: OpenVAS: Improve debug and error output

Status: Voted +4. In progress.

Purpose

Improve error reporting across all subsystems from the current output redirection of printf statement

References

Related Mail threads:

While using the latest patch, you may want to modify a library to call glib logging functions. A sample is included in the first patch (nasl_grammar and nasl_socket)

Rationale

Currently, output to .dump files is through printf statements that openvasd redirects to files. The printf statements neither have a timestamp nor an indicator of the source. Implementing C Macros may not work as expected.

Effects

Allow for a systemwide at runtime toggling of debug/error messages and possibly user defined formatting of error strings

Design and Implementation

The design goals should be to reuse the existing glib message output and debug functions to accomplish this by using g_log for all logging within OpenVAS.

To make the logging process versatile, openvasd logging configuration should be stored in a configuration file. We can reuse glib's keyfiles for this.
List of configuration options A sample configuration file
	#libnasl >critical messages are logged to stderr
	[libnasl]
	prepend=%p
	file=-
	level=critical

	#openvasd >warning messages have a pid prepended and
	#logged to openvasd.log
	[openvasd]
	prepend=%p
	file=/var/log/openvasd.log
	level=warnings

	#All >defaultlevel messages  that do not match the above
	#have the pid prepended and are logged to openvas.log
	[*]
	prepend=%p
	file=/var/log/openvas.log

History