To create new wiki account, please join us on #znc at Libera.Chat and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

Log: Difference between revisions

From ZNC
Jump to navigation Jump to search
>Resistance
m Spacing fix
>CapnRat
Add -sanitize argument and clarify the relative path argument.
Line 3: Line 3:


This module logs your conversations to some special place on your disk.
This module logs your conversations to some special place on your disk.
Depending on how the log module is loaded, the logs are stored:
  global:  ~/.znc/moddata/log/$user_$network_$channel_YYYYMMDD.log
  user:    ~/.znc/users/$user/moddata/log/$network_$channel_YYYYMMDD.log
  network: ~/.znc/users/$user/networks/$network/moddata/log/$channel_YYYYMMDD.log
(Note that <code>$channel</code> is not an acceptable argument, it's simply there for human readability purposes.  Also note that you will need to replace <code>~/.znc/</code> with the correct path to the data directory on your system if you use a non-standard setup.)
You can make a symlink for easier access to that location, e.g.
ln -s $HOME/.znc/users/dude/moddata/log/ $HOME/dude_irc_logs


== '''Notes''' ==
== '''Notes''' ==
Line 26: Line 13:
== Usage ==
== Usage ==


{{Module arguments|count=up to one|one=true|extra=Path where to store logs. It can contain <code>$USER</code>, <code>$NETWORK</code> and <code>$WINDOW</code> substitutes.}}
{{Module arguments
|count=one or two
|extra=<br>First argument: <code>-sanitize</code> Removes color codes and [https://en.wikipedia.org/wiki/C0_and_C1_control_codes C0 control codes] from the lines before logged.
<br>Second argument: Relative path where to store logs. It can contain <code>$USER</code>, <code>$NETWORK</code> and <code>$WINDOW</code> tokens as well as [[Timestamps|time format tokens]].
<br>Depending on the scope in which the log module is loaded, the path argument is relative to the following paths: (Note: <code>~/.znc/</code> might be different if you use a non-standard data directory):
  global:  ~/.znc/moddata/log/
  user:    ~/.znc/users/$USER/moddata/log/
  network: ~/.znc/users/$USER/networks/$NETWORK/moddata/log/
Default paths:
  global:  $USER_$NETWORK_$WINDOW_%Y%m%d.log
  user:    $NETWORK_$WINDOW_%Y%m%d.log
  network: $WINDOW_%Y%m%d.log
}}
Load the module to start logging, unload it to stop logging. Kinda easy, eh?
Load the module to start logging, unload it to stop logging. Kinda easy, eh?



Revision as of 17:08, 11 August 2014


This module logs your conversations to some special place on your disk.

Notes

In the znc-0.206 release this module is NOT a core module, see ZNC-Extra for more information on how to use it

In a future ZNC release, this module will mimic directory permissions set on its data directory (moddata/log, in whatever location appropriate to the mode it is running in; see above) when creating new subdirectories. However, as of 2013-08-20, umasks may interfere with it and result in less access being granted than expected. For example, the module may be unable to grant write access to Group or World (umask 0022).

To get the directory permission inheritance under ZNC 1.0, use this file and znc-buildmod log.cpp, then move the module to the ZNC modules directory.

Usage

Arguments

This user module takes one or two arguments.
First argument: -sanitize Removes color codes and C0 control codes from the lines before logged.
Second argument: Relative path where to store logs. It can contain $USER, $NETWORK and $WINDOW tokens as well as time format tokens.
Depending on the scope in which the log module is loaded, the path argument is relative to the following paths: (Note: ~/.znc/ might be different if you use a non-standard data directory):

 global:  ~/.znc/moddata/log/
 user:    ~/.znc/users/$USER/moddata/log/
 network: ~/.znc/users/$USER/networks/$NETWORK/moddata/log/

Default paths:

 global:  $USER_$NETWORK_$WINDOW_%Y%m%d.log
 user:    $NETWORK_$WINDOW_%Y%m%d.log
 network: $WINDOW_%Y%m%d.log

Read loading modules to learn more about loading modules. Load the module to start logging, unload it to stop logging. Kinda easy, eh?

Commands

This module does not support any commands.

pisg

The log module uses the "energymech" format so it can be used with pisg if so desired.

Example Config

   <channel="#znc">
       Logfile = "/home/znc/.znc/users/efnet/moddata/log/#znc_*.log"
       Format = "energymech"
       Network = "EFnet"
       OutputFile = "znc.html"
   </channel>