Refactoring error_log integration