Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a note about the rotating_file monolog handler #5137

Merged
merged 3 commits into from
May 25, 2015

Conversation

javiereguiluz
Copy link
Member

Q A
Doc fix? no
New docs? yes
Applies to all
Fixed tickets #1161

main:
type: rotating_file # <-- this value is usually 'stream'
path: %kernel.logs_dir%/%kernel.environment%.log
level: debug
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to add XML and PHP:

<!-- app/config/config_dev.xml -->
<?xml version="1.0" charset="UTF-8" ?>
<container xmlns=''http://symfony.com/schema/dic/services"
    xmlns:monolog="http://symfony.com/schema/dic/monolog">

    <monolog:config>
        <monolog:handler name="main"
            type="rotating_file"
            path="%kernel.logs_dir%/%kernel.environment%.log"
            level="debug"
        />
    </monolog:config>
</container>
// app/config/config_dev.php
$container->loadFromExtension('monolog', array(
    'handlers' => array(
        'main' => array(
            'type'  => 'rotating_file',
            'path'  => '%kernel.logs_dir%/%kernel.environment%.log',
            'level' => 'debug',
        ),
    ),
));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reminding me about this! Done in 7345c17.

main:
type: rotating_file
path: %kernel.logs_dir%/%kernel.environment%.log
level: debug
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should show max_files - maybe commented out, with a comment above/on the line that says it defaults to zero (infinite)

and explained the max_files configuration option
@javiereguiluz
Copy link
Member Author

I've just implemented the suggestions made by @weaverryan. Can this be considered finished now?

@timglabisch
Copy link
Contributor

👍

1 similar comment
@xabbuh
Copy link
Member

xabbuh commented May 25, 2015

👍

@weaverryan weaverryan merged commit db1e798 into symfony:2.3 May 25, 2015
weaverryan added a commit that referenced this pull request May 25, 2015
…aviereguiluz)

This PR was merged into the 2.3 branch.

Discussion
----------

Added a note about the rotating_file monolog handler

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes
| Applies to    | all
| Fixed tickets | #1161

Commits
-------

db1e798 Created a new section for rotating log files and explained the max_files configuration option
7345c17 Added XML and PHP configuration samples
31fd0db Added a note about the rotating_file monolog handler
@weaverryan
Copy link
Member

Thanks Javier! I took some liberty in re-wording the paragraph to be slightly shorter - but please let me know if anyone thinks I've changed any meaning or anything with it - sha: e7c984f

Cheers!

@javiereguiluz javiereguiluz deleted the mention_monolog_logrotate branch May 24, 2018 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants