Changeset 625
- Timestamp:
- 04/25/07 08:53:49 (1 year ago)
- Files:
-
- trunk/examples/foreignClassLoaders/index.php (modified) (1 diff)
- trunk/examples/logging/index.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/examples/foreignClassLoaders/index.php
r622 r625 1 1 <?php 2 2 echo 'The PHP code:<br />'; 3 echohighlight_file(__FILE__);3 highlight_file(__FILE__); 4 4 5 5 require '../../config/php/config.php'; trunk/examples/logging/index.php
r623 r625 1 1 <?php 2 2 echo 'The PHP code:<br />'; 3 echohighlight_file(__FILE__);3 highlight_file(__FILE__); 4 4 5 5 require '../../config/php/config.php'; … … 14 14 { 15 15 // initialize logger from configuration 16 // in a default application using the 17 // net.stubbles.websites.stubFrontController this can be done via the 16 // in a default application using the 17 // net.stubbles.websites.stubFrontController this can be done via the 18 18 // net.stubbles.util.log.stubLogPreInterceptor 19 19 $loggerXJConfFactory = new stubLoggerXJConfFactory(); 20 20 $loggerXJConfFactory->init(); 21 22 // both request and session normally are put into your application 23 // classes e.g. via stub(Pre|Post)Interceptor::(pre|post)process() 21 22 // both request and session normally are put into your application 23 // classes e.g. via stub(Pre|Post)Interceptor::(pre|post)process() 24 24 // or via stubPageElement::(isAvailable|process)() 25 25 $request = new stubWebRequest(); 26 26 $session = new stubPHPSession($request, 'SID'); 27 27 28 28 // now the real work for logging 29 // first we create a new logdata object with target trail and level 29 // first we create a new logdata object with target trail and level 30 30 // info 31 // the type of the logdata object can be configured in 31 // the type of the logdata object can be configured in 32 32 // config/xml/config.xml with the property net.stubbles.util.log.class 33 // if property not set an instance of 33 // if property not set an instance of 34 34 // net.stubbles.util.log.stubBaseLogData will be created 35 35 $logData = stubLogDataFactory::create($session, 'trail', stubLogger::LEVEL_INFO); 36 36 37 37 // we add some more data that we want to log 38 38 $logData->addData('logging/index.php'); 39 39 $logData->addData('foo'); 40 40 41 41 // and finally we send the logdata to all log appenders that listen for 42 42 // the level of the logdata (in this case stubLogger::LEVEL_INFO) 43 43 stubLogger::logToAll($logData); 44 45 // now take a look into the log directory, there should be a logfile 44 45 // now take a look into the log directory, there should be a logfile 46 46 // named trail-Y-m-d.log containing the logdata 47 47 // the contents are
