---
name: "log_custom"
section: "7ctrlproxy"
platform: "linux"
package: "ctrlproxy"
version: "2.6.1-1"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/log_custom"
---

# log\_custom(7ctrlproxy)

Logging in a predefined format

## NAME

log\_custom - Logging in a predefined format

## DESCRIPTION

Module that writes logs to one or more files using a defined format.

This module may be used to write out log files that can be parsed by scripts or bots or logs in the same format as your favorite IRC client.

## SUBSTITUTES

The configuration values define the syntax that is used to write out log file lines. In these configuration values, values beginning with a '%' can be substituted.

The following characters are allowed after a percent sign for all types of lines:

- h

  Current time of day, hours field.

- M

  Current time of day, number of minutes.

- s

  Current time of day, number of seconds.

- n

  Nick originating the line (saying the message, doing the kick, quitting, joining, etc).

- u

  Hostmask of the user originating the line.

- N

  Name of the current IRC network.

- S

  Name of the server (as set by the transport).

- %

  Percent sign

- 0,1,2,3,4,5,6,7,8,9

  Substituted with the respective argument in the IRC line.

- @

  Replaced by channel name if the message is directed to a channel, the nick name to which the message is being sent, or the name of the sender of the message when the receiver is the user running ctrlproxy.

  This substitute will be the name of the first channel on which the user is active if the line type is NICK or QUIT.

Each type of line also has some variables of it's own that it substitutes.

### join

- %c

  Name of the channel the user joins.

### part

- %c

  Name of the channel the user is leaving.

- %m

  Comment

### kick

- %t

  Nick of the user that is being kicked.

- %c

  Channel the user is being kicked from.

- %r

  Reason the user is being kicked.

### quit

- %m

  Comment.

### topic/notopic

- %c

  Name of the channel of which the topic is being changed.

- %t

  The new topic. Only set for 'topic', not for 'notopic'.

### mode

- %c

  Name of user or channel of which the mode is being changed.

- %p

  Change in the mode, e.g. *+oie*

- %t

  Target of which the mode is being changed.

To retrieve any additional arguments for a MODE command, use *%1*, *%2*, etc.

### notice/privmsg/action

- %t

  Name of channel or nickname of user to which the notice/privmsg/ or action is being sent.

- %m

  Message that is being sent.

### nick

- %r

  New nickname the user is changing his/her name to.

## CONFIGURATION

The following XML elements are supported:

- logfile

  Path to the logfile that will be written. Supports substitution depending on the type of line that is being parsed.

- join

  Format to use for lines where a user joins a channel.

- part

  Format to use for lines where a user leaves a channel.

- msg

  Format to use for 'regular' messages - when a user says something.

- notice

  Format to use for notices.

- action

  Format to use for CTCP actions (e.g. /me ...)

- mode

  Format to use for MODE changes (including bans)

- quit

  Format to use for quit lines.

- kick

  Format to use for kicks.

- topic

  Format to use for topic changes to a valid topic

- notopic

  Format to use when the topic is unset.

- nickchange

  Format to use when a user changes his/her nick name.

## EXAMPLE

```
		<ctrlproxy>
			<plugins>
				<plugin autoload="1" file="log_custom">
					<logfile>/home/jelmer/log/ctrlproxy/%@</logfile>
					<join>%h%M%s -!- User %n [%u] has joined %c</join>
					<part>%h%M%s -!- User %n [%u] has left %c [%m]</part>
					<quit>%h%M%s -!- User %n [%u] has quit [%m]</quit>
					<action>%h%M%s * %n %m</action>
				</plugin>
				<plugin autoload="1" file="socket"/>
			</plugins>
			<networks>
				<network name="OFTC">
					<servers><ipv4 host="irc.oftc.net"/></servers>
					<channel name="#flood"/>
				</network>
			</networks>
		</ctrlproxy>
```

## VERSION

This man page is valid for version 0.1 of the plugin.

## SEE ALSO

[ctrlproxyrc(5)](/ctrlproxyrc/5.md), [ctrlproxy(1)](/ctrlproxy/1.md), http://ctrlproxy.vernstok.nl/: *http://ctrlproxy.vernstok.nl/*, http://jelmer.vernstok.nl/ctrlproxy/: *http://jelmer.vernstok.nl/ctrlproxy/*

## AUTHOR

Jelmer Vernooij: *mailto:*
