Loading Please wait...

Zigmoyd Logging

Zigmoyd Offers extensive Logging mechanism. That can be used to track what zigmoyd is doing internally even what your application is doing on the top of zigmoyd.
Logging.png
Zigmoyd Logger can be used as a debugging tool. Logging is done by zLogger Class. Zigmoyd can log different activities in different media like file, terminal socket. there are two kind of log messages debug message or error message. error messages are what you must see. and you might turn off showing debug messages.

Log Configuration

Logging configuration is project specific e.g. you can do different configuration settings for different projects for logging. Logging activity is configured by etc/zig.ini.php files [log] directive.
	Configuring Logger
	-------------------
	Z_LOG_LEVEL                    => Logging Level
		0	        -> Loging is Disabled
		1         -> Log Only Errors
		2         -> Log Both Debug and Error
		-->> There is No option for Debug only Logs cause you must see the error Logs
	Z_LOG_MEDIA                    => Where to Log
		file      -> Log to file.
		tty       -> TTY Level Logging (Only on *nix system)
		socket    -> Socket Level Logging
	Z_LOG_DATE                    => date pattern in Log.file Name (if media is file)
	Z_LOG_STAMP_TIME              => Time Stamp pattrn default is "H:i:s"
	Z_LOG_STAMP_DATE              => Date Stamp default is "M d Y D"
	Z_LOG_TTY                     => tty Name e.g. /dev/pts/2 (The Name might vary System To System)
		put the tty Name here when tty media is used.
	Z_LOG_SOCK_HOST               => Socket Host of the Log Client
		Applicable when used socket media
	Z_LOG_SOCK_PORT               => Socket Port defaults to 9999
		Applicable when used socket media
	Z_LOG_SOCK_TIMEOUT            => Timeout on socket level logging defaults to 10;
	Z_LOG_UDEBUG                  => User debug off by default.
		If set to on only your Error/debug messages will be shown PHP's Own Internal
		Debug messages will not be shown.

Logging on file media

if your Z_LOG_MEDIA is set to file. Zigmoyd will log to a hard file in csv format. the log file name will be of current date pattern which is tuned through Z_LOG_DATE. Here is an example log file. which youcan oen with a text editor even with a spreadsheet viewer like Excel, kspread etc..
log-file.png
on the first column it stores the time Stamp. and the rest you can understand.

Logging on a terminal

This is a feature only for *nix platforms or nix alike platforms where each terminal have their unique Id to identify them uniquely. If somehow this can be made possible on windows it can also log on a windows terminal.
Attention:
Here *nix Platform means the server must be in *nix platform it doesn't matter what the client is using. Cause it will log on a server's Terminal
On tty level logging zigmoyd will instantly log the activities going on on the server's Terminal. so that you just open a terminal windows and you can see matrix like scrolling texts showing what is going on just like the following.
log-tty.png
the above screenshot is taken from a Linux Box.
Note:
why its not possible on Windows On *nix platform each terminal have an unique Id e.g. in debian system its /dev/pts/N e.g. like /dev/pts/1 , /dev/pts/2 etc.. when you open a terminal it also have an id. (e.g. file name) which is used to uniquely identify that terminal.But in windows all terminal have a same \con file name (I dont know much about windows) so its not possible to uniquely identify that terminal. and Zigmoyd requires you to pass the unique id of the terminal which it will use to log.
In windows you can use Logging on socket as a substitute.
to use tty level logging you need to set Z_LOG_MEDIA to tty and set to Z_LOG_TTY to the unique Id or the File Name of the terminal . e.g. Z_LOG_TTY = /dev/pts/2

Logging on socket

socket level logging can be used on both windows and Linux. as the name says you log through sockets on a same or differrent host on a specific port Her Zigmoyd Logger acts as a Log Client and sends Log messages to a log server of the specified Host and port. Z_LOG_SOCK_HOST and Z_LOG_SOCK_PORT is used to specify the log server's Host and port. By default it uses port 9999.

you can simply develop a GUI Socket server application in any language that listen on 9999 port to view the log messages. however zigmpyd provides a CLI application that acts as a log server4 on 9999 port however port can be changed.

you can start that socket server log viewer application from zigmoyd terminal by invoking log command

by invoking the log command you created a CLI log server on which zigmoyd Logger will log.

uDebug

while logging zigmoyd also logs its internal messages however if you want you can turn off all those system level messages and it will only show the debug messages fired by you using
zLogger::udebug("My debug message");
to turn uDebug On you can simply turn Z_LOG_UDEBUG to on. However you can turn it on at runtime invoking zLogger::udebugOn() or use zLogger::udebugOff() to turn it off.

Generated on Mon Oct 27 23:51:58 2008 for zigmoyd.kdevelop by doxygen 1.5.6