LogListener is a log collector provided by Cloud Log Service (CLS). You can install and deploy it on a server to collect logs quickly.
LogListener supports only Linux 64-bit operating systems and does not support Windows now. It is compatible with mainstream Linux operating system versions. If LogListener is incompatible with the Linux operating system version you use, please submit a ticket.
|CentOS (64-bit)||CentOS_6.8_64-bit, CentOS_6.9_64-bit, CentOS_7.2_64-bit, CentOS_7.3_64-bit, CentOS_7.4_64-bit, CentOS_7.5_64-bit, CentOS_7.6_64-bit, CentOS_8.0_64-bit|
|Ubuntu (64-bit)||Ubuntu Server_14.04.1_LTS_64-bit, Ubuntu Server_16.04.1_LTS_64-bit, Ubuntu Server_18.04.1_LTS_64-bit|
|Debian (64-bit)||Debian_8.2_64-bit, Debian_9.0_64-bit|
Download the LogListener installation package and decompress it to the installation path (
/usr/local/ in this example). Then go to the LogListener directory
The action command in a public network is as follows:
wget https://mirrors.tencent.com/install/cls/loglistener-linux-x64-2.6.1.tar.gz && tar -zxvf loglistener-linux-x64-2.6.1.tar.gz -C /usr/local && cd /usr/local/loglistener-2.6.1/tools && ./loglistener.sh install
The action command in a private network is as follows:
wget http://mirrors.tencentyun.com/install/cls/loglistener-linux-x64-2.6.1.tar.gz && tar -zxvf loglistener-linux-x64-2.6.1.tar.gz -C /usr/local && cd /usr/local/loglistener-2.6.1/tools && ./loglistener.sh install
loglistener/tools path, run the following command to initialize LogListener as the root user. By default, a private network is used to access the service:
./loglistener.sh init -secretid AKIDPEtPyKabfW8Z3Uspdz83xxxxxxxxxxx -secretkey whHwQfjdLnzzCE1jIf09xxxxxxxxxxxx -region ap-xxxxxx
You need to replace -secretid, -secretkey, -region, and -network in the command with the actual values. For more information, please see Parameter description below.
|secretid||Part of a TencentCloud API key, which is used to identify the API requester|
|secretkey||Part of a TencentCloud API key, which is used to encrypt the strings to create a signature so that Tencent Cloud server can validate the identity of the requester.|
|region||Region where CLS resides. Enter a region abbreviation here, such as
|network||Type of the network through which LogListener accesses the service by domain name. Valid values: intra (private network), internet (public network). Default value: intra.|
|ip||Server IP. If this parameter is left empty, LogListener will automatically get the local IP address.|
|label||Server group tag, which is required if you want to identify the server group. Multiple tags should be separated by comma.|
A private network domain name is used by default:
If you need to access the service by domain name through the public network, run the following command to set the network parameter
./loglistener.sh init -secretid AKIDPEtPyKabfW8Z3Uspdz83xxxxxxxxxxxx -secretkey whHwQfjdLnzzCE1jIf0xxxxxxxxxxxx -region ap-xxxxxx -network internet
- It is recommended to use a collaborator key if the collaborator is granted the read and write permission of CLS by the root account.
regionindicates the region of your CLS, instead of the region where your business server resides.
- If your CVM instance and logset are in the same region, we recommend you access the service domain name over the private network; otherwise, use the public network.
After LogListener is successfully installed, run the following command to start it:
The operation commands used in this document are only applicable to LogListener-2.2.4 and later versions. For operation commands applicable to earlier versions, see Earlier-Version LogListener Installation Guide.
/etc/init.d/loglistenerd (start|restart|stop) # Start, restart, stop
LogListener normally runs two processes:
loglistener/tools directory, run the uninstallation command as the admin:
Run the stop command to stop the existing LogListener.
Back up the breakpoint file directory (
loglistener/data) on the earlier version; for example, back up the legacy breakpoint file to the
Run the uninstallation command to uninstall the existing LogListener.
Download the latest version of LogListener and install and initialize it with relevant commands.
Copy the breakpoint file directory backed up in step 2 to the new LogListener directory.
cp -r /tmp/loglistener-backup/data loglistener-<version>/
You can change the value of
<version>. For example:
cp -r /tmp/loglistener-backup/data loglistener-2.2.8/
Run the start command to start the latest version of LogListener.