# Logging to a File with Craft CMS 4

DevFeed: [Logging to a File with Craft CMS 4](<https://devfeed.tech/articles/logging-to-a-file-with-craft-cms-4-31279.md>)

Original publisher: [Read original article](<https://nystudio107.com/blog/logging-to-a-file-with-craft-cms-4>)

Author: andrew@nystudio107.com (Andrew Welch)

Published: 2022-12-21T19:35:00Z

Content type: tutorial

Language: en

Sources: [nystudio107 | Articles on modern web development.](<https://devfeed.tech/sources/nystudio107-articles-on-modern-web-development.md>)

Topics: [Content Management System](<https://devfeed.tech/topics/cms.md>), [Logging](<https://devfeed.tech/topics/logging.md>), [log management](<https://devfeed.tech/topics/log-management.md>), [PHP](<https://devfeed.tech/topics/php.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [cms](<https://devfeed.tech/tags/cms.md>), [craft](<https://devfeed.tech/tags/craft.md>), [custom](<https://devfeed.tech/tags/custom.md>), [easily](<https://devfeed.tech/tags/easily.md>), [file](<https://devfeed.tech/tags/file.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [insights](<https://devfeed.tech/tags/insights.md>), [learn](<https://devfeed.tech/tags/learn.md>), [logging](<https://devfeed.tech/tags/logging.md>), [logs](<https://devfeed.tech/tags/logs.md>), [module](<https://devfeed.tech/tags/module.md>), [php](<https://devfeed.tech/tags/php.md>), [plugin](<https://devfeed.tech/tags/plugin.md>), [send](<https://devfeed.tech/tags/send.md>), [separate](<https://devfeed.tech/tags/separate.md>)

## AI overview

A tutorial showing how to configure Craft CMS 4 plugins or modules to send their logs to separate files using Monolog and a FileLog helper class. It explains log levels, category matching, namespaces, and storage/logs output.

## Source excerpt

Learn how to easily send logs from your custom module or plugin to a separate file in Craft CMS 4