Collectd

collectd is a daemon that regularly collects, transfers, and stores system information. It is typically used for collecting performance information and other system data like disk, memory, and network usage, and from many other sources using a number of plugins. Other software can then be used to read databases of collected information to plot it and analyze it.

Installation
First, determine which plugins you want on your system. The collectd wiki contains a list of plugins, or check the collectd man page. These plugins are specified as USE flags with a  prefix, though these can also be specified with a   variable in /etc/make.conf:

Collectd requires a plugin to enable any sort of logging. Make sure you enable the syslog plugin and/or the logfile plugin.

To write data, you need to enable write plugins. The rrdtool plugin is a common plugin. Data can be written to other collectd daemons using the network plugin.

To install:

To start collectd on start-up:

Configuration
With collectd and some plugins installed, enable them in the configuration file by uncommenting them, for instance, the syslog plugin:

Troubleshooting
Check the logs for errors after starting up to make sure everything is going smoothly.