Chapter 9. Logging

JSON

You can create a simple json logfile with PHPBU's json logger.

Example 9.1: json XML example

<!-- create a json logfile -->
<log type="json" target="backup/log.json"/>


Example 9.2: json JSON example

{"type": "json", "target": "backup/log.json"}


E-Mail

PHPBU uses SwiftMailer to send backup reports to one or more configured E-Mail-Addresses. If you just want to get notified if something went wrong, you can use the sendOnlyOnError option to not send any E-Mail on a successful backup.

Table 9.1. Capacity-Options

NameValueRequiredDefaultDescription
recipientsstringyes-List of emails separated by semicolon.
transportstringyes-SwiftMailer Transport that's used to send the E-Mail (mail, sendmail, smtp, null).
sender.mailstringphpbu@hostname-The sender E-Mail-Address
sender.namestringnoOS-UserThe sender name.
sender.namestringnoOS-UserThe sender name.
sendmail options    
sendmail.pathstringno-Path to local sendmail binary.
sendmail.optionsstringno-Sendmail options (e.g. -bs).
SMTP options    
smtp.portstringno587Port to use to connect to SMTP server.
smtp.hoststringno-SMTP hostname.
smtp.usernamestringno-The SMTP login.
smtp.passwordstringno-The SMTP password.
smtp.encryptionstringno-Type of encryption (e.g. ssl).


Example 9.3: mail XML example

<!-- use mail to keep up to date with you backup creation -->
<log type="mail">
  <option name="transport" value="mail"/>
  <option name="recipients" value="user.name@example.com"/>
</log>


Example 9.4: mail JSON example

{
  "type": "mail",
  "options": {
     "transport": "mail",
     "recipients": "user.name@example.com"
   }
}


Please open a ticket on GitHub to suggest improvements to this page. Thanks!