Logging variables are placeholders that are replaced with information about the current item, the current time etc. when a text is processed. They are used in many places throughout mAirList, for example:
- the various logging interfaces (text file, HTTP, XML, e-mail, …),
- filenames of the File Recorder and Aircheck Recorder,
- the dynamic columns of the playlist (see skin.ini),
- the Dynamic Text screen object,
- the custom text format of the library export,
- URLs and filenames of stream and auto file container items,
- the filename format of the playlist import (see below).
Syntax
A variable consists of a percent sign followed by a single character, e.g. %a for
the artist. Some variables take a parameter in curly braces, e.g. %u{Album} for the
value of the attribute “Album”:
Now playing: %a - %b (%u{Year})
Any text that is not a variable is copied unchanged. To insert a literal percent sign,
use %%.
Insert a ^ between the percent sign and the character in order to convert the value
to upper case, e.g. %^a for the artist in upper case.
If a variable is not available in the current context (e.g. item information when there is no item, or a file name for an item that is not a file), it is replaced with an empty string.
General Variables
These variables do not depend on a particular item.
| Variable | Description |
|---|---|
%Y | Current year, four digits |
%y | Current year, two digits |
%M | Current month, two digits |
%D | Current day, two digits |
%h | Current hour, two digits |
%m | Current minute, two digits |
%s | Current second, two digits |
%w, %w{n} | ISO 8601 week of the year, optionally padded with leading zeros to n digits |
%W, %W{n} | Year the ISO 8601 week belongs to (which may differ from the calendar year around New Year), optionally padded to n digits |
%T{format} | Current date and time in a custom date/time format. Append +n or -n to the format in order to add or subtract n seconds, e.g. %T{hh:nn+30} |
%S{format} | Start time of the item, in a custom date/time format. Useful when logging the end of playback |
%t | Tab character |
%r | Carriage return (CR, ASCII 13) |
%n | Line feed (LF, ASCII 10) |
%% | Percent sign |
%g | Unique ID of the playback operation, which is the same for the start and stop event of an item |
%R{key} | Value of the runtime data variable key, as set by a script with SetRuntimeData |
%# | Total number of current listeners across all encoder connections |
%x | Name of the computer |
%X | Name of the mAirList instance |
%B | Current title, as sent with a title update (e.g. the title of a stream) |
%N, %N{n} | Number of the region, optionally padded to n digits |
%N{CODE}, %N{NAME} | Code or name of the region |
Item Variables
These variables return information about the item being processed, e.g. the item that has just been started or stopped.
| Variable | Description |
|---|---|
%a | Artist |
%b | Title |
%C | Comment |
%E | End type |
%I | Item type, as internal identifier (e.g. Music, StationID) |
%J | Item type, as displayed in the user interface (e.g. “Station ID”) |
%u{key} | Value of the attribute key, e.g. %u{Album} |
%U | Database ID |
%V | External ID |
%c{marker} | Position of a cue marker in seconds, e.g. %c{CueIn}, %c{FadeOut}, %c{Ramp1} |
%k | Filename of the item icon |
%K | Item icon as Base64 encoded data |
Durations
| Variable | Description |
|---|---|
%l | Total duration of the item in seconds, with fractions |
%l{n} | Total duration in seconds, with n decimal places |
%l{format} | Total duration in a custom date/time format |
%L | Total duration as hh:nn:ss |
%p, %p{n}, %p{format} | Effective playback duration (from Cue In to Cue Out, or the point where the next item is started), in the same notations as %l |
%P | Effective playback duration as hh:nn:ss |
%e, %e{n}, %e{format} | Actual playback duration, i.e. how long the item was actually played, in the same notations as %l. Only available when logging the end of playback |
%d | Actual playback duration in units of 100 nanoseconds (integer) |
%F{format} | Expected finish time (current time plus effective playback duration), in a custom date/time format |
File Information
These variables are only available for file items.
| Variable | Description |
|---|---|
%1 | Filename with full path |
%2 | Filename without path |
%3 | Filename without path and extension |
%4 | First character of the filename |
%i{key} | Raw value of the file tag field key |
Subsequent Items
In the logging interfaces and in the stream title of the encoders, you can access the
items following the current item in the playlist, by
inserting one or more + signs after the percent sign: %+a is the artist of the next
item, %++a the artist of the item after that, and so on. This also works with all
other item variables, e.g. %+b or %+u{Album}. For subsequent items, %S returns
their expected start time.
If you combine + with the upper case modifier, the + signs come first, e.g. %+^a.
By default, only the next three items are considered. You can increase this limit in
mAirList.ini:
[Options]
NextLoggingLimit=10
Note that the limit applies to all subsequent items, before any filtering by item type takes place. For example, if you want to log the next three music items, and there may be up to four other items (jingles, news, advertising) in between, set the limit to 7 or higher.
Date/Time Formats
Variables with a date/time format parameter (%T, %S, %F, and %l, %p, %e)
use the format codes of Delphi’s
FormatDateTime
function. The most important ones are:
| Code | Meaning |
|---|---|
yyyy, yy | Year (four or two digits) |
mm, m | Month (with or without leading zero) |
dd, d | Day (with or without leading zero) |
ddd, dddd | Abbreviated or full name of the weekday |
hh, h | Hour (with or without leading zero) |
nn, n | Minute (with or without leading zero) |
ss, s | Second (with or without leading zero) |
zzz | Milliseconds |
"text" | Literal text |
Note that n (not m) stands for minutes.
mAirList supports the following additional codes:
| Code | Meaning |
|---|---|
epoch | Unix timestamp (seconds since 1970-01-01) |
hhh | Total number of hours, which may exceed 24 (useful for durations) |
sss | Total number of seconds (useful for durations) |
u | Tenths of a second |
v | Hundredths of a second |
Examples: %T{yyyy-mm-dd hh:nn:ss} gives the current date and time, e.g.
2026-10-26 14:30:00; %l{nn:ss} gives the duration of the item in minutes and
seconds, e.g. 03:45.
Playlist Import Filenames
The filename format of the playlist import (e.g. for files from external schedulers)
supports all general variables. The date and time variables (%Y, %M,
%D, %h, %T{...} etc.) refer to the date and hour of the playlist being imported,
not to the current time. For example, %Y%M%D.txt imports the file 20261026.txt for
the playlists of October 26, 2026.
In addition, the following variables are available:
| Variable | Description |
|---|---|
%B | Number of the block (e.g. advertising break) within the hour |
%2B, %3B | Number of the block, padded to two or three digits |
%N, %N{n} | Number of the region, optionally padded to n digits |
%2N, %3N | Number of the region, padded to two or three digits |
%N{CODE}, %N{NAME} | Code or name of the region |
Note that %B has a different meaning here than in logging, where it stands for the
current title.
HTTP Logging
When using the HTTP logging interface with multipart/form-data, the special variable
%ALBUMART can be used to send the album art of the item as binary form data, if
available. It must be the only content of the respective field value, without any other
text or variables.