[vbox-dev] Logging question

Michael Thayer michael.thayer at oracle.com
Fri Feb 18 22:27:06 GMT 2011


Hello Jos,

Le vendredi 18 février 2011 à 12:36 -0800, Jos Backus a écrit :
> How do I write to the log file? I would expect LogAlways to always write to
> the log, but it doesn't seem to work.
One of the Log macros.  E.g. Log() for "standard" debug logging, Log2()
for second-level debug logging, LogRel() for "standard" release logging.
Standard release logging always hits the release log, regardless of log
settings.  Other logging types appear in the release or debug logs
depending on the groups and types of logging enabled.  E.g.

    export VBOX_LOG=+shared_folders.e.l.l3.f

causes standard (.e == enable), level 2 (l), level 3 (l3) and flow (f)
logging (both debug and release logging) for the shared_folders log
group to hit the debug log file.  Other types of logging will silently
be dropped.

    export VBOX_LOG_RELEASE=+shared_folders.e.l.l3.f

does the same for the release log file, but only release logging (using
the LogRel* macros) will go in.
[Snip]

> For example, I want to insert some logging into the following files:
> 
> HostServices/SharedFolders/service.cpp
> HostServices/SharedFolders/vbsf.cpp
> Runtime/r3/posix/symlink-posix.cpp
> Additions/linux/sharedfolders/dirops.c
> Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.c
[Snip]
> But it's not at all clear what
> LOG_GROUPs these files map to.

src/VBox/HostServices/SharedFolders/shfl.h, which is included by the
first two files, contains

    #define LOG_GROUP LOG_GROUP_SHARED_FOLDERS

for which you need

    VBOX_LOG=+shared_folders.*

src/VBox/Runtime/r3/posix/symlink-posix.cpp contains

    #define LOG_GROUP RTLOGGROUP_SYMLINK

for which you need

    VBOX_LOG=+rt_symlink.*

Guest logging inside kernel modules is a rather different kettle of
fish, as it involved quite a bit more infrastructure.  To keep life
simple, you are best to only use release logging if you want to be sure
that it will be visible in the log file, but then it will always go to
the release log file on the host.

Hope that was alright for a start.  Our logging system is rather complex
and it would take a while to describe it comprehensively.

When I get round to it I may create a wiki entry about it.

Regards,

Michael
-- 
ORACLE Deutschland B.V. & Co. KG   Michael Thayer
Werkstrasse 24                     VirtualBox engineer
71384 Weinstadt, Germany           mailto:michael.thayer at oracle.com

Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Rijnzathe 6, 3454PV De Meern, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Jürgen Kunz, Marcel van de Molen, Alexander van der Ven 





More information about the vbox-dev mailing list