Skip to content Skip to main navigation Skip to footer

Understand SPE configuration

Basic configuration

SPE configuration by default is defined in the file {spe_root}/settings/phxspe.properties. This file is automatically created after running the phxadmin utility for the first time, usually used for initial configuration of the system. Otherwise it can be found in {spe_root}/data/phxspe.properties.template from which the actual configuration file may be populated and renamed manually. The format of the configuration file is text-based, well commented and human readable.

Read carefully these comments as there are some useful tips and tricks hidden inside. Let’s begin; pay attention to the comment about variables notation format mentioned in the configuration preamble:

# This is the default properties file for Phonexia Speech Engine
 #
 # Variables:
 # ${application.dir} path to application directory
 # ${system.env.<NAME>} system environment variable
 #
 # Property values containing backslash (\), for example Windows paths must be
 # escaped with double slash (C:\\spe). It is also possible to use slash (/) in
 # Windows path (C:/spe).

The following section describes standard network configuration and logging details. Administrators should know what to do, but we recommend to set up verbosity of the log to debug during first run as it helps in troubleshooting. When the system is configured and declared as stable, information log level will be sufficient. If you prefer saving log information into a database instead of a file, see the Database configuration chapter before changing the directive server.logging.destination = database.

# IP address and port for server listening
server.bind_ip = 0.0.0.0
server.port = 8600
# Server logging
# Level (trace, debug, information, warning, error, fatal)
server.logging.level = information
# Destination (console, file, database)
# Logging to database is supported only for MySQL
server.logging.destination = file
# Path to file where log is stored
server.logging.file = ${application.dir}log/phxspe.log

Did you notice the server.logging.file directive? They present the first example of using variables in the configuration. You can easily use this feature for creating custom log names when you collect logs from multiple servers or instances, for example, this directive:
server.logging.file = ${system.env.HOME}/log/${system.env.HOSTNAME}_phxspe.log
will in my case create the log file in /home/petrv/log/erebos_phxspe.log, because in my system environment, the HOME directory corresponds to “/home/petrv” and my HOSTNAME is “erebos”.

Please double check user privileges in the target directory or file in case the SPE instance is running under different user context.

Even if this example is for a Linux-based systems, in the MS Windows environment this principle works exactly in the same manner.

# Log file rotation based on log file size or time intervals
# Supported values:
# never no log rotation (default)
# [day,][hh]:mm the file is rotated on specified day/time day - day is specified
# as long or short day name (Monday|Mon, Tuesday|Tue, ... ) day can be omitted,
# in which case log is rotated every day hh - valid hour range is 00-23;
# hour can be omitted, in which case log is rotated every hour mm - valid minute range is 00-59; minute must be specified
# daily the file is rotated daily
# weekly the file is rotated every seven days
# monthly the file is rotated every 30 days
# <n> minutes the file is rotated every <n> minutes, where <n> is an integer greater than zero.
# <n> hours the file is rotated every <n> hours, where <n> is an integer greater than zero.
# <n> days the file is rotated every <n> days, where <n> is an integer greater than zero.
# <n> weeks the file is rotated every <n> weeks, where <n> is an integer greater than zero.
# <n> months the file is rotated every <n> months, where <n> is an integer greater than zero and a month has 30 days.
# <n> the file is rotated when its size exceeds <n> bytes.
# <n> K the file is rotated when its size exceeds <n> Kilobytes.
# <n> M the file is rotated when its size exceeds <n> Megabytes.
# Rotation strategy is based on UTC time
#
server.logging.file.rotation = daily

# The value specifies the maximum number of archived log files. If the number is exceeded,
# archived log files are deleted, starting with the oldest.
#
server.logging.file.purge_count = 5

The following directive is important mainly for tuning and initiation of the SPE. Turn it on when the system is prepared to go live.

# Use separate thread for logging. It may increase speed of logging but in case of server crash or if server is killed,
# some logs may be lost. Default is false.
server.logging.enable_async = false

# Name of server used in log. If it is not specified hostname is used instead.
#server.logging.database.identifier = spe

# Set set umask value for server (Linux only)
# server.umask = 0022

Related Articles