# # Sample /etc/git-fusion.log.conf # # Git Fusion log configuration # # Where and when should Git Fusion report events? # [general] # -- Where to write log ------------------------------------------------------- # Logging to file? # # The filename may include the following keyword parameters: # # %(repo)s -- name of the repository, if available # %(tmp)s -- system temporary directory # %(user)s -- user's home directory # filename: %(user)s/git-fusion.log.txt # # If the filename ends with .xml, the format will be in XML, and the format # and datefmt configuration values will be ignored. This is useful because # the p4gf_readlog.py script can then easily read and search the log files. # # See `p4gf_readlog.py --help` for more information. # When logging to file, you can control the format: # # format: %(asctime)s %(name)-22s %(levelname)-8s %(message)s # datefmt: %m-%d %H:%M:%S # # If '%(process)d' does not exist in the format string, the default behavior # will be to prepend it to the file logging format. # Set log-process=no to disable this automatic insertion of the process id. # Explicit '%(process)d ' in format strings will always be honored. # log-process: yes/no ( default=yes) # # log-process: no # When logging to a file, you can enable automatic log file rotation by # defining either one (or both) of the following settings. # # Maximum size of the log file, expressed in megabytes; default 32. # # max-size-mb: 32 # # Number of old log files to retain; default 16. # # retain-count: 16 # Logging to syslog or rsyslog? # # Ignores format and datefmt. # Disables logging to file. # # Logs to syslog facility "user", at various priority levels depending on # "What to write" later in this config file. Make sure you configure your # /etc/rsyslog.conf or /etc/syslog.conf to include events for facility "user" # at whatever priority levels you want recorded. # # Unless you have syslog listening on UDP port 514, you probably need to # specify a log "address" that is really your syslog's input "file". For most # linuxes, this is /dev/log. For Mac OS X, this is /var/run/syslog. # # handler: syslog /dev/log # or # handler: syslog /var/run/syslog #handler: syslog /dev/log # Logging to console? # # Disables logging to file. # # handler: console # Logging to separate files? # # This is recommended over logging to a single file due to the fact that Python # cannot coordinate writes to a single file from multiple processes. As such, # there is a risk of lost logging records. # # With neither a 'filename' nor a 'handler', Git Fusion will create separate # log files for each process, writing them to the .git-fusion/logs directory. # The format will be hard-coded to XML (see above about .xml files). Processes # involved within a single pull or push operation will have a common prefix in # the filename (a UUID of type 1). # # Since a large number of files are created, use the p4gf_prune_logs.py script # to remove older files. Note that logrotate will not help since the files will # rarely grow beyond a certain size, and the relevant criteria is the age of # the files, not the frequency of rotation. # # See `p4gf_prune_logs.py --help` for more information. # -- What to write in the log ------------------------------------------------- # Levels control log detail level. "debug" is very detailed, but makes logs # huge: several MB for each operation. "warning" is usually the best level: # you still see when something goes wrong. # # Levels: # debug3 Ludicrously detailed. # Per-row dumps of bulk operations such as 'p4 files //x/...' # debug2 Very detailed # Per-loop details leading up to decision points. # Perforce specs # debug Detailed. Several MB of log data for each operation. # info Very little data. # warning Something not quite right, Git Fusion will attempt to recover. # error Something wrong, Git Fusion cannot recover. # critical Not used in Git Fusion. # This is the default logging level for all events. root : debug # Override root's default for a few specific levels. # This script is called by a cron job once per minute. Recording it at debug # is too noisy. Doubly so if you already log cron jobs elsewhere. # p4gf_auth_update_authorized_keys : warning # Records (almost) every single shell or git command issued by Git Fusion # at "debug" level if command exits exit code 0, or at "error" level if # command exits with non-zero exit code. This is usually too much detail, so # leave at "info" or higher to squelch. # cmd : warning # Subcategories for shell and git command results, inherit the setting for # "cmd" unless overridden here. All record at level debug unless the commant # returns a non-zero exit code and Git Fusion doesn't expect such a code. # If so, record at level error. # # cmd.cmd # command # cmd.exit # exit code, usually 0 if ok, non-zero if error # cmd.out # stdout # cmd.err # stderr # Subcategories for Perforce command results, inherit the setting for # "p4" unless overridden here: # # p4.cmd # Command sent to Perforce server, at level "debug", # p4.err # Perforce errors, usually recorded at level "error" # p4.warn # Perforce warnings, usually recorded at level "warning" # p4.msgid # All Perforce responses as Perforce message objects, # # at level "debug2". # p4.out # Perforce results. # # Summary counts recorded at level "debug". # # Detailed results at level "debug3" # Git Fusion version information is recorded at level "info" for each # operation. Useful mostly if you frequently upgrade your Git Fusion server # and want that version information recorded in the log for debugging or bug # reporting later. # version : warning # P4PORT, P4USER, P4CLIENT, and other Perforce connection information is # recorded at level "info" for each Git Fusion operation. # context : warning # Internal performance timers: record at level "debug" some detailed timing # durations during pull or push operations. Show where the time (other than # the actual git portion of pull or push) goes. # p4gf_copy_to_git.time : warning p4gf_copy_to_p4.time : warning # Internal locks record at level "debug". These prevent multiple simultaneous # operations from corrupting Git Fusion. p4gf_lock : warning # Git/Perforce branch association code. # # "debug3" level includes a branch assignment line for every commit pushed. #p4gf_branch_id.graph : warning # "debug" level includes timing and branch length summary. #p4gf_branch_id.time : warning # When copying from Perforce to Git, Git Fusion creates a script for # git-fast-import. To see that script, set this to debug: p4gf_fastimport.script : warning # If 'git push' fails, write a huge failure report at "error" level. # To disable these reports, set this level to "critical". failures : error # Other log categories exist, usually one for each Git Fusion module. # See git-fusion/bin/*.py for a likely list of module names. # -- Sample /etc/rsyslog.d/git-fusion.conf ---------------------------------- # # # Route log messages from git-fusion ident to separate files. # :syslogtag,contains,"git-fusion[" -/var/log/git-fusion.log # :syslogtag,contains,"git-fusion-auth[" -/var/log/git-fusion-auth.log # :syslogtag,contains,"git-fusion-auth-keys[" -/var/log/git-fusion-auth-keys.log # # ----------------------------------------------------------------------------- # # Config files not working? # # Must be owned by root and root-writable: # $ ls /etc/rsyslog.d # total 24 # drwxr-xr-x 2 root root 4096 2012-07-24 14:50 ./ # drwxr-xr-x 81 root root 4096 2012-07-10 17:58 ../ # -rw-r--r-- 1 root root 311 2010-03-05 11:31 20-ufw.conf # -rw-r--r-- 1 root root 1630 2012-07-10 18:28 50-default.conf # -rw-r--r-- 1 root root 331 2012-07-24 14:49 git-fusion.conf # # Might need to restart rsyslogd: # $ sudo service rsyslog restart # # ----------------------------------------------------------------------------- # # Don't forget to rotate your logs! See /etc/logrotate.d/rsyslog and add a # pair of lines: # # /var/log/git-fusion-auth.log # /var/log/git-fusion.log # # # Enable authorized keys logging to a separate file # set root: debug for more information # otherwise only warnings are logged #[auth-keys] #root: warn #handler: syslog /dev/log # # # Authorization (audit) logging # # Logging with respect to authorization events, including pull/push requests, # is directed to a separate log for auditing purposes. This log can be # configured in the same manner as the general log, and supports the same # datefmt, format, filename, and handler options. # #[audit] #handler: syslog /dev/log #format: %(asctime)s %(userName)s@%(clientIp)s %(command)s %(repo)s #datefmt: %Y/%m/%d %H:%M:%S