Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixed broken link

...

  • Basic knowledge of PHP.

  • Basic knowledge of Treasure Data, including the TD Toolbelt.

  • PHP 5.3 or higher (for local testing).

The fluent-logger-php library does not work in Heroku (here's why).

Installing td-agent

Install td-agenton your application servers. td-agent sits within your application servers, focusing on uploading application logs to the cloud.

...

You can choose Amazon Linux 1 or Amazon Linux 2. Refer to Installing td-agent on Amazon AWS Linux.

MacOS X 10.11+

Code Block
linenumberstrue
$ open 'https://td-agent-package-browser.herokuapp.com/3/macosx/td-agent-3.1.1-0.dmg'


MacOS X 10.11.1 (El Capitan) introduces some security changes. After the td-agent is installed, edit the /Library/LaunchDaemons/td-agent.plist file to change /usr/sbin/td-agent to /opt/td-agent/usr/sbin/td-agent.


Windows Server 2012+

The Windows installation requires the steps detailed in:

...

Code Block
linenumberstrue
# Unix Domain Socket Input
<source>
  type unix
  path /var/run/td-agent/td-agent.sock
</source>

# Treasure Data Output
<match td.*.*>
  type tdlog
  endpoint api.treasuredata.com
  apikey YOUR_API_KEY
  auto_create_table
  buffer_type file
  buffer_path /var/log/td-agent/buffer/td
  use_ssl true
</match>


YOUR_API_KEY should be your actual apikey string. Using a [write-only API key](access-control#rest-apis-access) is recommended.

Restart your agent when the following lines are in place.

...

Code Block
linenumberstrue
$ td tables
+------------+------------+------+-----------+
| Database   | Table      | Type | Count     |
+------------+------------+------+-----------+
| test_db    | test_table | log  | 1         |
| test_db    | follow     | log  | 1         |
+------------+------------+------+-----------+


The first argument of post() determines the database name and table name. If you specify `td.test_db.test_table`, the data is imported into the table *test_table* within the database *test_db*. They are automatically created at upload time.

Tips on Production Deployment

...