Server Logs
Server Logs are used to fetch and view logs of a server fast and convenient way.
To configure a Server Log open the server form, navigate to the Server Logs
tab and add a new record in the list.
Access Rules
Group | Action | Condition |
---|---|---|
User | R | Access level is "User" and user is added in "Users" in related Servers |
Manager | R | Access level is "Manager" or less and user is added in "Users" or "Managers" in related Servers |
Manager | CRU | Access level is "Manager" or less and user is added in "Managers" in related Servers |
Manager | CRUD | Access level is "Manager" and user is added in "Managers" in related Servers and record is created by the user |
Root | CRUD | Any record |
Info
CRUD stands for Create, Read, Update, Delete.
Server Logs Configuration
Servers Logs are located in the "Server Logs" tab of the Server form.
Fields
Field | Description |
---|---|
Name | Readable name of the log. |
Access Level | Minimum access level required to access this this Server Log. |
Log Type | Defines the way logs are fetched. |
Command | A command that is used to fetch the logs. This option is available only log type set to Command . Important: please ensure that the selected command can be executed multiple times in parallel to avoid any potential issues. |
Use Sudo | Use sudo if required to run this command. |
File | A file that is used to fetch the log. This option is not available when configuring a log for a Server Template. |
File Template | A file template that is used to create a file when a new Server is created from a Server Template. This option is available only when configuring a log for a Server Template. |
Log Type
Log Type | Description |
---|---|
Command |
Log is fetched from a Command output. |
File |
Log is fetched from a File content. |
Tip
Log output supports HTML formatting. You can implement your custom log formatter by overriding the _format_log_text()
function of the cx.tower.server.log
model.
YAML Format Specification
cetmix_tower_model: server_log
reference: log_from_file_3
name: Log from file
log_type: file # Possible values: file, command
use_sudo: false # Boolean. Only for command logs
file_template_id: demo_file_template_4 # File template reference or File Template object. Only for file logs
command_id: create_directory # Command reference or a Command object. Only for command logs
Please refer to the General YAML Format Specification for more details.