# Where Are OpenMage CSS/JS Minify Module Errors Logged? (Log Location & Prefix)

> Find OpenMage CSS/JS Minify module errors in var/log/system.log. Discover the exact log file location and the system.log prefix CssjsMinify for quick debugging.

- Repository: [Fabrizio Balliano/openmage-cssjs-minify](https://github.com/fballiano/openmage-cssjs-minify)
- Tags: how-to-guide
- Published: 2026-03-01

---

**OpenMage CSS/JS Minify module errors are written to `var/log/system.log` with the hardcoded prefix "CssjsMinify:".**

The **Fballiano_CssjsMinify** module for OpenMage (Magento 1) provides automatic CSS and JavaScript minification. When directory creation fails, file copying errors occur, or minification exceptions are caught, the module delegates logging to Magento’s native `Mage::log` facility. Understanding the exact log location and message format is essential for monitoring production environments and debugging minification failures.

## Default Log Location for OpenMage CSS/JS Minify Errors

The module does not specify a custom log file in any of its `Mage::log` invocations. Consequently, Magento writes all entries to the default system log:

```

var/log/system.log

```

This behavior is controlled by Magento’s global logging configuration (`dev/log/active` and `dev/log/file`). If logging is enabled but no custom file is defined, `system.log` serves as the catch-all destination for all `Mage::log` calls that omit a filename argument.

## The CssjsMinify Log Prefix

Every log entry generated by the module begins with the literal prefix **"CssjsMinify:"** (including the trailing colon). This string is hard-coded directly into the message parameter of each `Mage::log` call within [`app/code/community/Fballiano/CssjsMinify/Model/Observer.php`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/app/code/community/Fballiano/CssjsMinify/Model/Observer.php).

The consistent prefix allows administrators to grep or filter logs efficiently. For example, a typical error entry appears as:

```

2024-01-15T14:32:01+00:00 ERR (3): CssjsMinify: Failed to minify JS /path/to/file.js: Error message here

```

## Examining Error Messages in the Source Code

The [`Observer.php`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/Observer.php) file contains specific error handlers for different minification stages. Each handler logs distinct failure scenarios using the standard prefix.

### Directory Creation Failures

When the module fails to create the `minified` directory at line 33, it logs:

```php
Mage::log("CssjsMinify: Failed to create minified directory: {$minifiedDir}", Zend_Log::ERR);

```

### JavaScript Processing Errors

Lines 51 and 59 handle JavaScript file operations. Line 51 logs copy failures:

```php
Mage::log("CssjsMinify: Failed to copy JS {$path}", Zend_Log::ERR);

```

Line 59 catches minification exceptions:

```php
Mage::log("CssjsMinify: Failed to minify JS {$path}: " . $e->getMessage(), Zend_Log::ERR);

```

### CSS Processing Errors

The CSS handling mirrors JavaScript at lines 81 and 89. Copy failures:

```php
Mage::log("CssjsMinify: Failed to copy CSS {$path}", Zend_Log::ERR);

```

Minification exceptions:

```php
Mage::log("CssjsMinify: Failed to minify CSS {$path}: " . $e->getMessage(), Zend_Log::ERR);

```

### Cleanup and Maintenance Errors

The module also logs directory scanning failures (line 112):

```php
Mage::log("CssjsMinify: Failed to scan minified directory: {$minifiedDir}", Zend_Log::ERR);

```

And file deletion warnings during cleanup (line 128):

```php
Mage::log("CssjsMinify: Failed to delete old minified file: {$file}", Zend_Log::WARN);

```

## How to Filter and Monitor CssjsMinify Logs

To extract only the minification-related entries from `system.log`, use command-line tools or PHP scripts that target the "CssjsMinify:" prefix.

**Command line (grep):**

```bash
grep "CssjsMinify:" var/log/system.log

```

**Command line (real-time monitoring):**

```bash
tail -f var/log/system.log | grep "CssjsMinify:"

```

**PHP script for programmatic access:**

```php
<?php
$logFile = Mage::getBaseDir('log') . DS . 'system.log';
if (file_exists($logFile)) {
    $lines = file($logFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
    $cssjsErrors = array_filter($lines, function($line) {
        return strpos($line, 'CssjsMinify:') !== false;
    });
    
    foreach ($cssjsErrors as $error) {
        echo $error . "\n";
    }
}
?>

```

## Summary

- **Log Location:** `var/log/system.log` (Magento’s default system log).
- **Log Prefix:** All messages start with **"CssjsMinify:"**.
- **Source File:** All logging occurs in [`app/code/community/Fballiano/CssjsMinify/Model/Observer.php`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/app/code/community/Fballiano/CssjsMinify/Model/Observer.php).
- **Log Levels:** Errors use `Zend_Log::ERR`; cleanup warnings use `Zend_Log::WARN`.
- **Filtering:** Use `grep "CssjsMinify:"` to isolate module-specific entries.

## Frequently Asked Questions

### Can I change the log file location for the CSS/JS Minify module?

No, the module hard-codes all `Mage::log` calls without a custom filename parameter. To redirect these entries, you would need to modify [`app/code/community/Fballiano/CssjsMinify/Model/Observer.php`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/app/code/community/Fballiano/CssjsMinify/Model/Observer.php) and add a fourth argument to each `Mage::log` call specifying your preferred file name, or override the model via a local code pool rewrite.

### What log levels does the OpenMage CSS/JS Minify module use?

The module uses two distinct Zend_Log levels. **Errors** (directory creation failures, copy failures, minification exceptions, and scan failures) are logged at `Zend_Log::ERR`. **Warnings** (failed deletion of old minified files during cleanup) are logged at `Zend_Log::WARN`. Both levels write to the same default system log file.

### How do I disable logging for the CssjsMinify module?

Since the module does not implement a configuration flag to disable logging, you must either disable Magento’s global logging by setting `dev/log/active` to `0` in [`app/etc/local.xml`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/app/etc/local.xml), or comment out the `Mage::log` lines in [`app/code/community/Fballiano/CssjsMinify/Model/Observer.php`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/app/code/community/Fballiano/CssjsMinify/Model/Observer.php). Disabling global logging will stop all Magento logging, not just this module.

### Where can I find the source code that generates these log entries?

All logging logic resides in the observer model at [`app/code/community/Fballiano/CssjsMinify/Model/Observer.php`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/app/code/community/Fballiano/CssjsMinify/Model/Observer.php). Specific lines of interest include line 33 (directory creation), lines 51 and 59 (JavaScript handling), lines 81 and 89 (CSS handling), and lines 112 and 128 (cleanup operations). This file is part of the community code pool in the Fballiano_CssjsMinify package.