---
name: "pmnotifyerr"
section: "3"
platform: "linux"
package: "libpcp3-dev"
version: "4.3.2+really4.3.1-0.1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/pmNotifyErr"
---

# pmnotifyerr(3)

standard handling of error messages

Part of [pmNotifyErr(3)](/pmNotifyErr/3.md).

## NAME

**pmNotifyErr**, **pmSyslog** - standard handling of error messages

## C SYNOPSIS

**#include \<pcp/pmapi.h\>**

**void pmNotifyErr(int** *priority***, const char \****message***, ...);**\
 **void pmSyslog(int** *onoff***);**

**cc ... -lpcp**

## DESCRIPTION

These routines provide standard handling for error messages from within the internals of Performance Co-Pilot (PCP) daemons and Performance Metric Domain Agents (PMDAs).

**pmNotifyErr** is a [**printf**(3)](/printf/3.md) style function that will format *message* (and any subsequent arguments) with a prefix that includes the current date and time from [**ctime**(3)](/ctime/3.md), the name of the application from [**pmGetProgname**(3)](/pmGetProgname/3.md), the process's id from [**getpid**(2)](/getpid/2.md) and the *priority*.

*priority* should be one of the level **LOG\_** macros defined for [**syslog**(3)](/syslog/3.md). Most typically this would be **LOG\_INFO**, **LOG\_WARNING** or **LOG\_ERR**.

**pmNotifyErr** writes to standard error, which for daemons and PMDAs has most likely been redirected to a log file using [**pmOpenLog**(3)](/pmOpenLog/3.md). Additionally *message* (and any subsequent arguments) may be sent forwarded to [**syslog**(3)](/syslog/3.md) if **pmSyslog** has previously been called with *onoff* having a non-zero value.

Forwarding to [**syslog**(3)](/syslog/3.md) can be disabled at any time by calling **pmSyslog** with *onoff* having a zero value, and this is the starting state for each PCP application.

## SEE ALSO

[**getpid**(2)](/getpid/2.md), [**ctime**(3)](/ctime/3.md), [**PMAPI**(3)](/PMAPI/3.md), [**pmGetProgname**(3)](/pmGetProgname/3.md), [**pmOpenLog**(3)](/pmOpenLog/3.md), [**printf**(3)](/printf/3.md) and [**syslog**(3)](/syslog/3.md).
