diff options
author | Gergely Nagy <algernon@balabit.hu> | 2012-08-10 16:35:40 +0200 |
---|---|---|
committer | Gergely Nagy <algernon@balabit.hu> | 2012-08-10 16:53:06 +0200 |
commit | 1c707ea147d40ff2119b430512fe4e45c564ce32 (patch) | |
tree | f834b2cca835a4f8aa634117a0c15380fc2a70a6 /lib | |
parent | 2c5439de564f25e4a839586f2f764d2ad8c99968 (diff) | |
download | libumberlog-1c707ea147d40ff2119b430512fe4e45c564ce32.tar.gz libumberlog-1c707ea147d40ff2119b430512fe4e45c564ce32.tar.xz libumberlog-1c707ea147d40ff2119b430512fe4e45c564ce32.zip |
Support disabling discovery for the LD_PRELOAD variant
When compiled with --disable-discovery, the LD_PRELOAD variant will
have automatic field discovery disabled. This does not affect the
linkable library, which always has them enabled by default.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/umberlog.c | 8 | ||||
-rw-r--r-- | lib/umberlog.rst | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/umberlog.c b/lib/umberlog.c index be0b9d6..b64d715 100644 --- a/lib/umberlog.c +++ b/lib/umberlog.c @@ -77,7 +77,13 @@ static struct char hostname[_POSIX_HOST_NAME_MAX + 1]; } ul_process_data = { - PTHREAD_MUTEX_INITIALIZER, 0, LOG_USER, NULL, + PTHREAD_MUTEX_INITIALIZER, +#if __UL_PRELOAD__ + DEFAULT_DISCOVER_FLAGS, +#else + LOG_UL_ALL, +#endif + LOG_USER, NULL, -1, (uid_t)-1, (gid_t)-1, { 0, } }; diff --git a/lib/umberlog.rst b/lib/umberlog.rst index 5ae5c7c..7c3af99 100644 --- a/lib/umberlog.rst +++ b/lib/umberlog.rst @@ -125,7 +125,8 @@ flags: LOG_UL_ALL Enable all automatically discovered fields. This is the default - setting. + setting for the linkable library, but for the LD_PRELOAD variant, it + can be changed at the library's configure time. LOG_UL_NODISCOVER Disable all automatic discovery, and only include the *message*, |