{"action":"created","issue":{"url":"https://api.github.com/repos/kbond/ZenstruckBackupBundle/issues/10","labels_url":"https://api.github.com/repos/kbond/ZenstruckBackupBundle/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/kbond/ZenstruckBackupBundle/issues/10/comments","events_url":"https://api.github.com/repos/kbond/ZenstruckBackupBundle/issues/10/events","html_url":"https://github.com/kbond/ZenstruckBackupBundle/issues/10","id":118050553,"number":10,"title":"Extremely large logs because of $logger->debug in RsyncSource","user":{"login":"kachkaev","id":608862,"avatar_url":"https://avatars.githubusercontent.com/u/608862?v=3","gravatar_id":"","url":"https://api.github.com/users/kachkaev","html_url":"https://github.com/kachkaev","followers_url":"https://api.github.com/users/kachkaev/followers","following_url":"https://api.github.com/users/kachkaev/following{/other_user}","gists_url":"https://api.github.com/users/kachkaev/gists{/gist_id}","starred_url":"https://api.github.com/users/kachkaev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kachkaev/subscriptions","organizations_url":"https://api.github.com/users/kachkaev/orgs","repos_url":"https://api.github.com/users/kachkaev/repos","events_url":"https://api.github.com/users/kachkaev/events{/privacy}","received_events_url":"https://api.github.com/users/kachkaev/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-20T14:20:05Z","updated_at":"2015-11-20T14:54:56Z","closed_at":"2015-11-20T14:54:55Z","body":"Symfony production environment usually has a ```fingers_corssed``` logger, which dumps all log messages to a file only if there is an error.\r\n\r\nDuring a backup, an error may occur when syncing to a remote server, e.g. if the connection is weak.  Because of [```RsyncSource```](https://github.com/kbond/ZenstruckBackupBundle/blob/v0.5.0/src/Source/RsyncSource.php), the logs may become terribly long.\r\n\r\nHere is the cause:\r\n```php\r\n$process->run(\r\n            function ($type, $buffer) use ($logger) {\r\n                $logger->debug($buffer);\r\n            }\r\n        );\r\n```\r\n\r\nIn my project, I rsync a directory with about 10,000 small files and then send the archive to a remote folder. The cron job runs every 5 minutes. If the upload fails, the ```fingers_crossed``` logger calls the ```nested``` one and appends thousands of lines to a file in ```app/log```. Thus, some of the recent daily logs grew up to 800 MB! :–)\r\n\r\nI know that you can disable debug messages in the nested logger like this, but I'm not sure this a good solution:\r\n\r\n```yml\r\n# app/config_prod.yml\r\nmonolog:\r\n    handlers:\r\n        main:\r\n            type:         fingers_crossed\r\n            action_level: error\r\n            handler:      nested\r\n        nested:\r\n            type:  rotating_file\r\n            path:  \"%kernel.logs_dir%/%kernel.environment%.log\"\r\n            level: warning # <------ instead of debug\r\n            max_files: 10\r\n        console:\r\n            type:  console\r\n```\r\n\r\nSeeing debug messages for failed app request is really handy, so disabling them globally is undesired.\r\n\r\nWhat problem does the detailed logging of ```rsync``` solve? In which cases may it be helpful?\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/kbond/ZenstruckBackupBundle/issues/comments/158423151","html_url":"https://github.com/kbond/ZenstruckBackupBundle/issues/10#issuecomment-158423151","issue_url":"https://api.github.com/repos/kbond/ZenstruckBackupBundle/issues/10","id":158423151,"user":{"login":"kbond","id":127811,"avatar_url":"https://avatars.githubusercontent.com/u/127811?v=3","gravatar_id":"","url":"https://api.github.com/users/kbond","html_url":"https://github.com/kbond","followers_url":"https://api.github.com/users/kbond/followers","following_url":"https://api.github.com/users/kbond/following{/other_user}","gists_url":"https://api.github.com/users/kbond/gists{/gist_id}","starred_url":"https://api.github.com/users/kbond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbond/subscriptions","organizations_url":"https://api.github.com/users/kbond/orgs","repos_url":"https://api.github.com/users/kbond/repos","events_url":"https://api.github.com/users/kbond/events{/privacy}","received_events_url":"https://api.github.com/users/kbond/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T14:54:55Z","updated_at":"2015-11-20T14:54:55Z","body":"Fixed in https://github.com/kbond/php-backup/commit/e396e090e34276bdfbbb35b30d80cf94d938d3af (v1.2.0)"}}