LogTail



Logtail is a log collection agent that is provided by Log Service. You can use Logtail to collect logs from multiple data sources in real time. These sources include Alibaba Cloud Elastic Compute Service (ECS) instances, on-premises servers, and servers that are provided by other cloud service providers. Logtail.com client library. 🪵 Logtail Integration For Python. This repository contains the Logtail Python library, turning your application logs into rich structured events. Description The p4 logtail command displays the last block (s) of the error log, and the offset for the next block, when available. Output consists of a series of lines in tagged format. The first line is '.

Name

logtail2 - print log file lines that have not been read

Synopsis

Logtail Github

logtail2 [-t] -flogfile [-ooffsetfile]

Description

logtail2 reads a specified file (usually a log file) and writes to the standard outputthat part of it which has not been read by previous runs of logtail2. It prints the appropriate number of bytes from the end of logfile, assumingthat all changes that are made to it are to add new characters to it.

logfile must be a plain file. A symlink is not allowed.

logtail2 stores the information about how much of it has already been read in a separate file called offsetfile. offsetfile can beomitted. If omitted, the file named logfile.offset in the same directory which contains logfile is used by default.

If offsetfile is not empty, the inode of logfile is checked. If the inode is changed, logtail2 uses the heuristics stored in/usr/share/logtail/detectrotate/ to find a file that might be the rotated logfile and prints it starting with the stored offset. It then proceedsto simply print the entire new file and generates a new offsetfile. If the inode is not changed but logfile is shorter than it was at thelast run of logtail2, it writes a warning message to the standard output.

Options

0
successful
65
cannot get the size of logfile
66
general file or directory access issue
73
cannot write offsetfile

Author

The original logtail was written in C by Craig H. Rowland <crowland@psionic.com>. Thisversion of logtail is a modification of Paul Slootman's re-implementation in perl. enhanced by the Debian Logcheck Team<logcheck-devel@lists.alioth.debian.org>.

This manual was written by Oohara Yuuma <oohara@libra.interq.or.jp> and enhanced by the Debian Logcheck Team<logcheck-devel@lists.alioth.debian.org>..

See Also

logcheck(8)-->Duck

Applies to: SQL Server (all supported versions)

This topic is relevant only for backup and restore of SQL Server databases that are using the full or bulk-logged recovery models.

A tail-log backup captures any log records that have not yet been backed up (the tail of the log) to prevent work loss and to keep the log chain intact. Before you can recover a SQL Server database to its latest point in time, you must back up the tail of its transaction log. The tail-log backup will be the last backup of interest in the recovery plan for the database.

NOTE: Not all restore scenarios require a tail-log backup. You do not need a tail-log backup if the recovery point is contained in an earlier log backup. Also, a tail-log backup is unnecessary if you are moving or replacing (overwriting) a database and do not need to restore it to a point of time after its most recent backup.

Scenarios That Require a Tail-Log Backup

We recommend that you take a tail-log backup in the following scenarios:

  • If the database is online and you plan to perform a restore operation on the database, begin by backing up the tail of the log. To avoid an error for an online database, you must use the ... WITH NORECOVERY option of the BACKUP Transact-SQL statement.

  • If a database is offline and fails to start and you need to restore the database, first back up the tail of the log. Because no transactions can occur at this time, using the WITH NORECOVERY is optional.

  • If a database is damaged, try to take a tail-log backup by using the WITH CONTINUE_AFTER_ERROR option of the BACKUP statement.

    On a damaged database backing up the tail of the log can succeed only if the log files are undamaged, the database is in a state that supports tail-log backups, and the database does not contain any bulk-logged changes. If a tail-log backup cannot be created, any transactions committed after the latest log backup are lost.

The following table summarizes the BACKUP NORECOVERY and CONTINUE_AFTER_ERROR options.

BACKUP LOG optionComments
NORECOVERYUse NORECOVERY whenever you intend to continue with a restore operation on the database. NORECOVERY takes the database into the restoring state. This guarantees that the database does not change after the tail-log backup. The log will be truncated unless the NO_TRUNCATE option or COPY_ONLY option is also specified.
Important: Avoid using NO_TRUNCATE, except when the database is damaged. You may need to put the database into single-user mode to obtain exclusive access before performing the restore with NORECOVERY. After the restore, set the database back to multi-user mode.
CONTINUE_AFTER_ERRORUse CONTINUE_AFTER_ERROR only if you are backing up the tail of a damaged database.
When you use back up the tail of the log on a damaged database, some of the metadata ordinarily captured in log backups might be unavailable. For more information, see Tail-Log Backups That Have Incomplete Backup Metadata, in this topic.

Tail-Log backups that have incomplete backup metadata

Tail log backups capture the tail of the log even if the database is offline, damaged, or missing data files. This might cause incomplete metadata from the restore information commands and msdb. However, only the metadata is incomplete; the captured log is complete and usable.

Logtail Linux

If a tail-log backup has incomplete metadata, in the backupset table, has_incomplete_metadata is set to 1. Also, in the output of RESTORE HEADERONLY, HasIncompleteMetadata is set to 1.

If the metadata in a tail-log backup is incomplete, the backupfilegroup table will be missing most of the information about filegroups at the time of the tail-log backup. Most of the backupfilegroup table columns are NULL; the only meaningful columns are as follows:

  • backup_set_id
  • filegroup_id
  • type
  • type_desc
  • is_readonly

Related Tasks

To create a tail-log backup, see Back Up the Transaction Log When the Database Is Damaged (SQL Server).

To restore a transaction log backup, see Restore a Transaction Log Backup (SQL Server).

See Also

Long-tailed Duck

BACKUP (Transact-SQL)
RESTORE (Transact-SQL)
Back Up and Restore of SQL Server Databases
Copy-Only Backups (SQL Server)
Transaction Log Backups (SQL Server)
Apply Transaction Log Backups (SQL Server)
SQL Server Transaction Log Architecture and Management Guide