The Log Service supports timestamped text logs encoded in UTF-8 that are generated within the past seven days and are no more than 15 minutes later than the current time.
The Log Service supports direct data writing using APIs (SDKs are currently available in four languages: Java, Python, PHP, and C#). It provides Linux- and Windows-compatible Logtail used to collect real-time updated logs from disk files.
- If the logs generated by application programs are not flushed into disk, those logs can be written directly to the Log Service through APIs.
- Logs that are written into disks in real time can be collected by Logtail.
You can use Logtail to collect the ECS logs that are flushed into disk as follows:
- Create a Logstore on the Log Service Console.
- Perform Logtail configuration.
- Create a machine group.
- Execute the installation script to install the Logtail agent.
- Apply the Logtail configurations to the machine group.
You can only write data generated during the past seven days using an API. However, Logtail does not support historical data collection for the moment.
You can adjust the number of shards in a Logstore as needed. Logtail collects data at a maximum rate of 1 MB/s on ECS.
For collection of Nginx access logs, the Nginx configurations of web servers are the same. Logs are written into files with the same name on different machines. (In this case, Logtail collects logs properly.) When NAS is used, Logtail may have missing logs or encounter a collection error if the Nginx logs on multiple machines are written into the same file on NAS (concurrent write to the same file).To avoid this problem, ensure that the logs on different web servers are written into different files on NAS.