# ****************************************************** # * # * Name: tst-app-logging.pl # * # * Design Phase: # * Author: John Miner # * Date: 05/10/2012 # * Purpose: Logging to file and event logs. # * # ****************************************************** # Declare all variables use strict; # Set library path use lib 'c:\perl-depot\logs'; # Use perl module use AppLog; # Set properties & Write to logs AppLog::SetFileName('c:\perl-depot\logs\MyApp.log'); AppLog::SetAppName('MyApp'); AppLog::SetMessage('This is a real error!'); AppLog::SetEvent('ERROR'); AppLog::Write(); # Set properties & Write to logs AppLog::SetMessage('Log action for audit purposes.'); AppLog::SetEvent('INFORMATION'); AppLog::Write();