use OW\Logger\LoggerFactory; $logger = LoggerFactory::createLogger('file', '/path/to/file.log'); $logger->info('Hello World');
use OW\Logger\LoggerFactory; $pdo = new PDO('mysql:host=localhost;dbname=test', 'username', 'password'); $logger = LoggerFactory::createLogger('pdo', $pdo); $logger->error('Database connection failed.');This example creates a PDO logger and logs an error message to a MySQL database. In both examples, the OW getLogger package library is being used to create and configure the logger objects.