summaryrefslogtreecommitdiffstats
path: root/lib/cee-syslog.h
Commit message (Collapse)AuthorAgeFilesLines
* Rename the project to libumberlogGergely Nagy2012-03-231-51/+0
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Add the timestamp to the JSON payload too.Gergely Nagy2012-03-211-0/+1
| | | | | | Add high-precision timestamp to the JSON payload (unless disabled). Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Export the syslog() wrapper as cee_legacy_syslog()Gergely Nagy2012-03-211-0/+4
| | | | | | | For documentation purposes, and for clarity, export the syslog() wrappers under a sensible name. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Implement UID/GID discovery.Gergely Nagy2012-03-201-2/+3
| | | | | | | | | | | We now cache the uid and gid upon openlog(), and add it to the automatic fields unless discovery is disabled. The caching can be turned off by passing either the LOG_CEE_NOCACHE or the LOG_CEE_NOCACHE_UID flag to openlog(). The latter also disables caching the gid. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Implement a wrapper for setlogmask()Gergely Nagy2012-03-201-0/+1
| | | | | | | | Since we'd like to avoid doing useless work during logging, wrap setlogmask() too, and save the mask set, so during _cee_vsyslog(), we can bail out early, if our priority is not set in the mask. Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
* Implement the new syslog() overrides.Gergely Nagy2012-03-201-2/+6
| | | | | | | | | | | | | | | | | | | | Changed the API, so that we have cee_(v)syslog(), which is the enhanced syslog API, that takes key-value pairs in addition to the traditional message, and outputs CEE-JSON to syslog. We also have (v)syslog() overrides, that do the same, just without the extra key-value pairs. Both of these add some extra stuff, via _cee_discover(): at the moment, this is the facility, the priority and the pid. We also override openlog(), that stores some info in thread-local storage. That info is used by _cee_discover(). For future use, this patch also defines LOG_CEE_NODISCOVER and LOG_CEE_NOCACHE. They're not used anywhere yet, though. Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
* Lift out the formatting into a separate function.Gergely Nagy2012-03-191-0/+3
| | | | | | | | | | | | | | The formatting itself is now lifted out to _cee_vformat(), which returns a const char *, and puts the JSON object into its first (output) parameter. We then export cee_format() and cee_vformat(), that use this, strdup and return the result, and free the JSON object too. cee_vsyslog() was changed to use _cee_vformat(), because it does not need to strdup() the result. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Initial import.Gergely Nagy2012-03-191-0/+37