ApplicationLogger Class: - Structured JSON logging to logs/application.log - Tracks all actions: master_asset_submission, global_to_local_transform, box_upload, omg_api_lookup - Captures: timestamp, user email/name, status, detailed data, IP address, user agent - Methods: getRecentLogs(), getLogsByAction(), getLogsByUser(), getStatistics() Logging Integration: - submit.php: Logs all asset submissions (success/failure) - process-csv.php: Logs all CSV transformations - upload-to-box.php: Logs all Box uploads - Tracks campaign numbers, business units, file counts, dates Logs Viewer (logs-viewer.php): - New tab "Activity Logs" in navigation - Statistics dashboard (total actions, success rate, errors, unique users) - Filterable table (by action type, user, date range) - View detailed data for each log entry (expandable JSON) - Export to CSV functionality - Shows last 100 entries by default (configurable) Email Service Enhancement: - Added SMTP support (in addition to Mailgun API) - Configured for smtp.mailgun.org with provided credentials - Sends notifications to logged-in user email - Proper SMTP protocol implementation with AUTH LOGIN OMG API Configuration: - Added 'enabled' flag (currently false due to 403 error) - Added 'fallback_business_unit' for when OMG disabled - Uses X-API-Key header format - Comprehensive error logging - When API permissions are fixed, set enabled=true Security: - logs/ directory excluded from git - .gitkeep file to preserve directory structure - Protected by .htaccess (log files already blocked) Usage: - All activity automatically logged - View reports at /logs-viewer.php - Export logs as CSV for analysis - Filter by action type, user, or time period - Monitor system health and usage patterns 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
37 lines
1.3 KiB
PHP
37 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* Shared Header and Navigation
|
|
*/
|
|
|
|
// Get current page
|
|
$currentPage = basename($_SERVER['PHP_SELF'], '.php');
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title><?php echo $pageTitle ?? 'L\'Oréal Box Asset Submission'; ?></title>
|
|
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap" rel="stylesheet">
|
|
<link rel="stylesheet" href="css/styles.css">
|
|
</head>
|
|
<body>
|
|
<div class="page-header">
|
|
<div class="header-content">
|
|
<h1>L'Oréal OMG Assistant Global</h1>
|
|
<div class="user-info">
|
|
<span><?php echo htmlspecialchars($user['email']); ?></span>
|
|
</div>
|
|
</div>
|
|
<nav class="tab-navigation">
|
|
<a href="index.php" class="tab <?php echo $currentPage === 'index' ? 'active' : ''; ?>">
|
|
Master Global Asset Submission
|
|
</a>
|
|
<a href="global-to-local.php" class="tab <?php echo $currentPage === 'global-to-local' ? 'active' : ''; ?>">
|
|
Global to Local
|
|
</a>
|
|
<a href="logs-viewer.php" class="tab <?php echo $currentPage === 'logs-viewer' ? 'active' : ''; ?>">
|
|
Activity Logs
|
|
</a>
|
|
</nav>
|
|
</div>
|