PMDAOPENLOG(3)

πŸ“¦
version 7.2.2 Β· 3 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– PMDAOPENLOG πŸ’–

okay bestie, welcome to PMDAOPENLOG(3), part of the Library Functions Manual β€” yes it's a section 3 page, yes we're gonna make it cute, yes every single fact is staying. πŸŽ€

✨ NAME ✨

pmdaOpenLog β€” redirect stderr to a logfile


🌸 C SYNOPSIS 🌸

#include <pcp/pmapi.h>
#include <pcp/pmda.h>

void pmdaOpenLog(pmdaInterface * dispatch);

cc ... -lpcp_pmda -lpcp

πŸ¦‹ DESCRIPTION πŸ¦‹

So what does this lil function do? pmdaOpenLog redirects stderr to the logfile specified in the dispatch structure β€” and that logfile got set by the previous call to pmdaDaemon(3) or pmdaGetOpt(3). Like, it's the glow-up your error output has been waiting for. ✨

The first line of the log file will detail the name of the calling process, the host the process is running on, and the current time. Receipts, basically. πŸ“

On top of that, the log is appended with the exit time of the process by a routine registered with atexit(3). So it says hi and it says bye. iconic behavior honestly. πŸ‘‘

πŸ’… CAVEAT πŸ’…

The PMDA must be using PMDA_INTERFACE_2 or later, as specified in the call to pmdaDSO(3) or pmdaDaemon(3). no cap, this is not optional, if you're on an older interface it's giving ✨not supported✨.

🌈 PCP ENVIRONMENT 🌈

Environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. On each installation, the file /etc/pcp.conf contains the local values for these variables.

The $PCP_CONF variable may be used to specify an alternative configuration file, as described in pcp.conf(5). πŸ“‚

Values for these variables may be obtained programmatically using the pmGetConfig(3) function. iykyk. 🫢


⭐ SEE ALSO ⭐


and that's the whole page bestie!! this one shipped as part of Performance Co-Pilot (that's the PCP girlies πŸ’œ), and the page itself is dated/labelled PMDAOPENLOG(3) β€” so yeah, same name top and bottom, we love a symmetrical moment. mwah, go log something πŸ’–βœ¨

πŸ“¦ where this page comes from