{"action":"created","comment":{"url":"https://api.github.com/repos/collective/collective.fingerpointing/pulls/comments/78818766","id":78818766,"diff_hunk":"@@ -12,32 +14,33 @@\n FORMAT = '%(asctime)s - %(levelname)s - %(message)s'\n \n # by default, the audit log will use the same location used for the event log\n-eventlog = getattr(getConfiguration(), 'eventlog', None)\n+zopeConf = getConfiguration()\n \n-if eventlog is None:\n-    # we are running tests\n-    logfile = os.path.join('.', AUDITLOG)\n-else:\n-    try:\n-        logpath = eventlog.handler_factories[0].instance.baseFilename\n-        logfolder = os.path.split(logpath)[0]\n-        logfile = os.path.join(logfolder, AUDITLOG)\n-    except AttributeError:\n-        # we are in the debug console\n-        logfile = os.path.join('.', AUDITLOG)\n+auditlogConf = getattr(\n+    zopeConf,\n+    'product_config',\n+    {}\n+).get(\n+    'collective.fingerpointing',\n+    {}\n+)\n \n+logfile = auditlogConf.get('audit-log', './audit.log')\n logger = logging.getLogger(PROJECTNAME)\n logger.setLevel(logging.INFO)\n logger.info('Start logging audit information to ' + AUDITLOG)\n \n-# support automatic rotation of audit log files at timed intervals\n-# we can later implement a way to make this configurable\n-handler = logging.handlers.TimedRotatingFileHandler(\n-    logfile, when='midnight', backupCount=30)\n+if logfile is not None:\n+    # Use the rotatingfilehandler to rotate at X Bytes,\n+    # maxBytes can be 0 to never rotate.\n+    maxBytes = int(auditlogConf.get('audit-log-max-size', 0))\n+    backupCount = int(auditlogConf.get('audit-log-old-files', 30))","path":"src/collective/fingerpointing/logger.py","position":49,"original_position":49,"commit_id":"cf027b7f4f7675aa031152267fd96763cead203f","original_commit_id":"cf027b7f4f7675aa031152267fd96763cead203f","user":{"login":"hvelarde","id":341393,"avatar_url":"https://avatars.githubusercontent.com/u/341393?v=3","gravatar_id":"","url":"https://api.github.com/users/hvelarde","html_url":"https://github.com/hvelarde","followers_url":"https://api.github.com/users/hvelarde/followers","following_url":"https://api.github.com/users/hvelarde/following{/other_user}","gists_url":"https://api.github.com/users/hvelarde/gists{/gist_id}","starred_url":"https://api.github.com/users/hvelarde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hvelarde/subscriptions","organizations_url":"https://api.github.com/users/hvelarde/orgs","repos_url":"https://api.github.com/users/hvelarde/repos","events_url":"https://api.github.com/users/hvelarde/events{/privacy}","received_events_url":"https://api.github.com/users/hvelarde/received_events","type":"User","site_admin":false},"body":"default here must be `1`","created_at":"2016-09-14T19:19:45Z","updated_at":"2016-09-14T19:19:45Z","html_url":"https://github.com/collective/collective.fingerpointing/pull/47#discussion_r78818766","pull_request_url":"https://api.github.com/repos/collective/collective.fingerpointing/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/collective/collective.fingerpointing/pulls/comments/78818766"},"html":{"href":"https://github.com/collective/collective.fingerpointing/pull/47#discussion_r78818766"},"pull_request":{"href":"https://api.github.com/repos/collective/collective.fingerpointing/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/collective/collective.fingerpointing/pulls/47","id":82345618,"html_url":"https://github.com/collective/collective.fingerpointing/pull/47","diff_url":"https://github.com/collective/collective.fingerpointing/pull/47.diff","patch_url":"https://github.com/collective/collective.fingerpointing/pull/47.patch","issue_url":"https://api.github.com/repos/collective/collective.fingerpointing/issues/47","number":47,"state":"open","locked":false,"title":"Fix the audit.log path (fixes: #45) and make the rotating configureable","user":{"login":"pcdummy","id":358074,"avatar_url":"https://avatars.githubusercontent.com/u/358074?v=3","gravatar_id":"","url":"https://api.github.com/users/pcdummy","html_url":"https://github.com/pcdummy","followers_url":"https://api.github.com/users/pcdummy/followers","following_url":"https://api.github.com/users/pcdummy/following{/other_user}","gists_url":"https://api.github.com/users/pcdummy/gists{/gist_id}","starred_url":"https://api.github.com/users/pcdummy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcdummy/subscriptions","organizations_url":"https://api.github.com/users/pcdummy/orgs","repos_url":"https://api.github.com/users/pcdummy/repos","events_url":"https://api.github.com/users/pcdummy/events{/privacy}","received_events_url":"https://api.github.com/users/pcdummy/received_events","type":"User","site_admin":false},"body":"We don't want rotating of the audit.log so we added a option to disable that (defaults to on - rotate).\r\n\r\nAlso we have Mailinglogger installed which breaks the path detection.\r\n\r\nSigned-off-by: Rene Jochum <rene@jochums.at>","created_at":"2016-08-23T11:12:33Z","updated_at":"2016-09-14T19:19:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31b7f051021e2606282cec79ceef27031cdd6aee","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/collective/collective.fingerpointing/pulls/47/commits","review_comments_url":"https://api.github.com/repos/collective/collective.fingerpointing/pulls/47/comments","review_comment_url":"https://api.github.com/repos/collective/collective.fingerpointing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/collective/collective.fingerpointing/issues/47/comments","statuses_url":"https://api.github.com/repos/collective/collective.fingerpointing/statuses/cf027b7f4f7675aa031152267fd96763cead203f","head":{"label":"collective:audit.log_path","ref":"audit.log_path","sha":"cf027b7f4f7675aa031152267fd96763cead203f","user":{"login":"collective","id":362867,"avatar_url":"https://avatars.githubusercontent.com/u/362867?v=3","gravatar_id":"","url":"https://api.github.com/users/collective","html_url":"https://github.com/collective","followers_url":"https://api.github.com/users/collective/followers","following_url":"https://api.github.com/users/collective/following{/other_user}","gists_url":"https://api.github.com/users/collective/gists{/gist_id}","starred_url":"https://api.github.com/users/collective/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/collective/subscriptions","organizations_url":"https://api.github.com/users/collective/orgs","repos_url":"https://api.github.com/users/collective/repos","events_url":"https://api.github.com/users/collective/events{/privacy}","received_events_url":"https://api.github.com/users/collective/received_events","type":"Organization","site_admin":false},"repo":{"id":34258514,"name":"collective.fingerpointing","full_name":"collective/collective.fingerpointing","owner":{"login":"collective","id":362867,"avatar_url":"https://avatars.githubusercontent.com/u/362867?v=3","gravatar_id":"","url":"https://api.github.com/users/collective","html_url":"https://github.com/collective","followers_url":"https://api.github.com/users/collective/followers","following_url":"https://api.github.com/users/collective/following{/other_user}","gists_url":"https://api.github.com/users/collective/gists{/gist_id}","starred_url":"https://api.github.com/users/collective/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/collective/subscriptions","organizations_url":"https://api.github.com/users/collective/orgs","repos_url":"https://api.github.com/users/collective/repos","events_url":"https://api.github.com/users/collective/events{/privacy}","received_events_url":"https://api.github.com/users/collective/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/collective/collective.fingerpointing","description":"Keep track of different events and write them down to an audit log.","fork":false,"url":"https://api.github.com/repos/collective/collective.fingerpointing","forks_url":"https://api.github.com/repos/collective/collective.fingerpointing/forks","keys_url":"https://api.github.com/repos/collective/collective.fingerpointing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/collective/collective.fingerpointing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/collective/collective.fingerpointing/teams","hooks_url":"https://api.github.com/repos/collective/collective.fingerpointing/hooks","issue_events_url":"https://api.github.com/repos/collective/collective.fingerpointing/issues/events{/number}","events_url":"https://api.github.com/repos/collective/collective.fingerpointing/events","assignees_url":"https://api.github.com/repos/collective/collective.fingerpointing/assignees{/user}","branches_url":"https://api.github.com/repos/collective/collective.fingerpointing/branches{/branch}","tags_url":"https://api.github.com/repos/collective/collective.fingerpointing/tags","blobs_url":"https://api.github.com/repos/collective/collective.fingerpointing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/collective/collective.fingerpointing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/collective/collective.fingerpointing/git/refs{/sha}","trees_url":"https://api.github.com/repos/collective/collective.fingerpointing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/collective/collective.fingerpointing/statuses/{sha}","languages_url":"https://api.github.com/repos/collective/collective.fingerpointing/languages","stargazers_url":"https://api.github.com/repos/collective/collective.fingerpointing/stargazers","contributors_url":"https://api.github.com/repos/collective/collective.fingerpointing/contributors","subscribers_url":"https://api.github.com/repos/collective/collective.fingerpointing/subscribers","subscription_url":"https://api.github.com/repos/collective/collective.fingerpointing/subscription","commits_url":"https://api.github.com/repos/collective/collective.fingerpointing/commits{/sha}","git_commits_url":"https://api.github.com/repos/collective/collective.fingerpointing/git/commits{/sha}","comments_url":"https://api.github.com/repos/collective/collective.fingerpointing/comments{/number}","issue_comment_url":"https://api.github.com/repos/collective/collective.fingerpointing/issues/comments{/number}","contents_url":"https://api.github.com/repos/collective/collective.fingerpointing/contents/{+path}","compare_url":"https://api.github.com/repos/collective/collective.fingerpointing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/collective/collective.fingerpointing/merges","archive_url":"https://api.github.com/repos/collective/collective.fingerpointing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/collective/collective.fingerpointing/downloads","issues_url":"https://api.github.com/repos/collective/collective.fingerpointing/issues{/number}","pulls_url":"https://api.github.com/repos/collective/collective.fingerpointing/pulls{/number}","milestones_url":"https://api.github.com/repos/collective/collective.fingerpointing/milestones{/number}","notifications_url":"https://api.github.com/repos/collective/collective.fingerpointing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/collective/collective.fingerpointing/labels{/name}","releases_url":"https://api.github.com/repos/collective/collective.fingerpointing/releases{/id}","deployments_url":"https://api.github.com/repos/collective/collective.fingerpointing/deployments","created_at":"2015-04-20T12:16:59Z","updated_at":"2016-03-28T18:35:31Z","pushed_at":"2016-09-14T14:23:18Z","git_url":"git://github.com/collective/collective.fingerpointing.git","ssh_url":"git@github.com:collective/collective.fingerpointing.git","clone_url":"https://github.com/collective/collective.fingerpointing.git","svn_url":"https://github.com/collective/collective.fingerpointing","homepage":null,"size":255,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":10,"forks":1,"open_issues":10,"watchers":2,"default_branch":"master"}},"base":{"label":"collective:master","ref":"master","sha":"ae6f1493e651b23eba8e01ec26a753fb4dc94334","user":{"login":"collective","id":362867,"avatar_url":"https://avatars.githubusercontent.com/u/362867?v=3","gravatar_id":"","url":"https://api.github.com/users/collective","html_url":"https://github.com/collective","followers_url":"https://api.github.com/users/collective/followers","following_url":"https://api.github.com/users/collective/following{/other_user}","gists_url":"https://api.github.com/users/collective/gists{/gist_id}","starred_url":"https://api.github.com/users/collective/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/collective/subscriptions","organizations_url":"https://api.github.com/users/collective/orgs","repos_url":"https://api.github.com/users/collective/repos","events_url":"https://api.github.com/users/collective/events{/privacy}","received_events_url":"https://api.github.com/users/collective/received_events","type":"Organization","site_admin":false},"repo":{"id":34258514,"name":"collective.fingerpointing","full_name":"collective/collective.fingerpointing","owner":{"login":"collective","id":362867,"avatar_url":"https://avatars.githubusercontent.com/u/362867?v=3","gravatar_id":"","url":"https://api.github.com/users/collective","html_url":"https://github.com/collective","followers_url":"https://api.github.com/users/collective/followers","following_url":"https://api.github.com/users/collective/following{/other_user}","gists_url":"https://api.github.com/users/collective/gists{/gist_id}","starred_url":"https://api.github.com/users/collective/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/collective/subscriptions","organizations_url":"https://api.github.com/users/collective/orgs","repos_url":"https://api.github.com/users/collective/repos","events_url":"https://api.github.com/users/collective/events{/privacy}","received_events_url":"https://api.github.com/users/collective/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/collective/collective.fingerpointing","description":"Keep track of different events and write them down to an audit log.","fork":false,"url":"https://api.github.com/repos/collective/collective.fingerpointing","forks_url":"https://api.github.com/repos/collective/collective.fingerpointing/forks","keys_url":"https://api.github.com/repos/collective/collective.fingerpointing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/collective/collective.fingerpointing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/collective/collective.fingerpointing/teams","hooks_url":"https://api.github.com/repos/collective/collective.fingerpointing/hooks","issue_events_url":"https://api.github.com/repos/collective/collective.fingerpointing/issues/events{/number}","events_url":"https://api.github.com/repos/collective/collective.fingerpointing/events","assignees_url":"https://api.github.com/repos/collective/collective.fingerpointing/assignees{/user}","branches_url":"https://api.github.com/repos/collective/collective.fingerpointing/branches{/branch}","tags_url":"https://api.github.com/repos/collective/collective.fingerpointing/tags","blobs_url":"https://api.github.com/repos/collective/collective.fingerpointing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/collective/collective.fingerpointing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/collective/collective.fingerpointing/git/refs{/sha}","trees_url":"https://api.github.com/repos/collective/collective.fingerpointing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/collective/collective.fingerpointing/statuses/{sha}","languages_url":"https://api.github.com/repos/collective/collective.fingerpointing/languages","stargazers_url":"https://api.github.com/repos/collective/collective.fingerpointing/stargazers","contributors_url":"https://api.github.com/repos/collective/collective.fingerpointing/contributors","subscribers_url":"https://api.github.com/repos/collective/collective.fingerpointing/subscribers","subscription_url":"https://api.github.com/repos/collective/collective.fingerpointing/subscription","commits_url":"https://api.github.com/repos/collective/collective.fingerpointing/commits{/sha}","git_commits_url":"https://api.github.com/repos/collective/collective.fingerpointing/git/commits{/sha}","comments_url":"https://api.github.com/repos/collective/collective.fingerpointing/comments{/number}","issue_comment_url":"https://api.github.com/repos/collective/collective.fingerpointing/issues/comments{/number}","contents_url":"https://api.github.com/repos/collective/collective.fingerpointing/contents/{+path}","compare_url":"https://api.github.com/repos/collective/collective.fingerpointing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/collective/collective.fingerpointing/merges","archive_url":"https://api.github.com/repos/collective/collective.fingerpointing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/collective/collective.fingerpointing/downloads","issues_url":"https://api.github.com/repos/collective/collective.fingerpointing/issues{/number}","pulls_url":"https://api.github.com/repos/collective/collective.fingerpointing/pulls{/number}","milestones_url":"https://api.github.com/repos/collective/collective.fingerpointing/milestones{/number}","notifications_url":"https://api.github.com/repos/collective/collective.fingerpointing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/collective/collective.fingerpointing/labels{/name}","releases_url":"https://api.github.com/repos/collective/collective.fingerpointing/releases{/id}","deployments_url":"https://api.github.com/repos/collective/collective.fingerpointing/deployments","created_at":"2015-04-20T12:16:59Z","updated_at":"2016-03-28T18:35:31Z","pushed_at":"2016-09-14T14:23:18Z","git_url":"git://github.com/collective/collective.fingerpointing.git","ssh_url":"git@github.com:collective/collective.fingerpointing.git","clone_url":"https://github.com/collective/collective.fingerpointing.git","svn_url":"https://github.com/collective/collective.fingerpointing","homepage":null,"size":255,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":10,"forks":1,"open_issues":10,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/collective/collective.fingerpointing/pulls/47"},"html":{"href":"https://github.com/collective/collective.fingerpointing/pull/47"},"issue":{"href":"https://api.github.com/repos/collective/collective.fingerpointing/issues/47"},"comments":{"href":"https://api.github.com/repos/collective/collective.fingerpointing/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/collective/collective.fingerpointing/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/collective/collective.fingerpointing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/collective/collective.fingerpointing/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/collective/collective.fingerpointing/statuses/cf027b7f4f7675aa031152267fd96763cead203f"}}}}
{"actor":{"display_login":"hvelarde"}}