---
name: "Cvlogit"
section: "3"
platform: "linux"
package: "liblcgdm-dev"
version: "1.10.0-2+b3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/Cvlogit"
---

# Cvlogit(3)

log server messages in local log or in system logger

## NAME

Clogit - log server messages in local log or in system logger

## SYNOPSIS

**#include "Clog.h"**

**int Cinitlog (char \****cmd***,** **char \****logfile***)**

**int Clogit (int** *level***,** **char \****func***,** **char \****msg***,** **...)**

**int Cvlogit (int** *level***,** **char \****func***,** **char \****msg***,** **va\_list** *ap***)**

## DESCRIPTION

**Cinitlog** initializes the server logging routines.

**Clogit** logs server messages in a local log or in the system logger.

**Cvlogit** is the same as **Clogit** but takes a va\_list instead of a variable number of arguments.

- *cmd*

  specifies a string to be prepended to the syslog messages.

- *logfile*

  specifies a path for the server log file. If set to **syslog**, the system logger will be used. By default, only messages with level at least as important as LOG\_INFO will be logged. The level threshold can be changed with the environment variable LOG\_PRIORITY.

- *level*

  is associated with the message. The possible values, in order of decreasing importance are:

  - **LOG\_EMERG**

    - **LOG\_ALERT**

    - **LOG\_CRIT**

    - **LOG\_ERR**

    - **LOG\_WARNING**

    - **LOG\_NOTICE**

    - **LOG\_INFO**

    - **LOG\_DEBUG**

    - *func*

  is the name of the function that issues the message.

- *msg*

  is a format as in printf.

## RETURN VALUE

These routines return 0 if the operation was successful or -1 if the operation failed. In the latter case, **serrno** is set appropriately.

## ERRORS

- **EFAULT**

  *logfile* is a NULL pointer.

- **ENAMETOOLONG**

  The length of *logfile* exceeds **CA\_MAXPATHLEN**.
