Start Up Options
Server Program Options
By default the servers is started on the localhost and only processes running on that system could access the server.
Options can be specified via command line arguments, in the configuration file, or through environment variables.
Options from the command line have the highest priority.
Options from the configuration file are the second highest priority.
Options from environment variables are the lowest priority.
The server provides the following startup arguments (Server Program Options
).
Argument |
Description |
---|---|
-h [–help] |
Produce help message. |
-c [ –config ] |
Load configuration from specified file. |
-l [ –log-config ] |
Load log4cplus configuration from specified file. |
–host |
Set host name (default localhost). |
-p [ –port ] |
Set port number (default 8080). |
-u [ –url-path ] |
URL base path (default preface). |
–preface-classifier-path |
Path to Preface classifier data file. |
-t [ –concurrent-tasks ] |
Set the maximum number of concurrent PreFace tasks. Defaults to number of cores available. |
-q [ –queue-size ] |
Set the maximum number of PreFace tasks that can be queued up. Defaults unlimited. |
–certificate |
Path to PEM certificate keystore file, enabling TLS. |
–password |
TLS certificate private key password (use if private key is encrypted). |
–enable-cors |
Enable Cross-Origin Resource Sharing. |
–cors-acao-policy |
Access-Control-Allow-Origin policy (default “*”). |
–cors-acac-policy |
Access-Control-Allow-Credentials policy (default “”). |
–cors-aceh-policy |
Access-Control-Expose-Headers policy (default “”). |
–cors-acma-policy |
Access-Control-Max-Age policy (default “”). |
–cors-acam-policy |
Access-Control-Allow-Methods policy (default “GET,POST,OPTIONS”). |
–cors-acah-policy |
Access-Control-Allow-Headers policy (default “Content-Type”). |
–endpoint-decryption-key |
Path to endpoint decryption key, enabling encrypted requests. |
–password-encrypted |
Encrypted password using symmetric key. |
–password-decryption-iv |
Initiation vector that was used to encrypt the password. |
–password-decryption-key |
File containing symmetric key to encrypt password. |
–db-host |
Transaction counting database host server. |
–db-user |
Transaction counting database login user name. |
–db-pw |
Transaction counting database login password. |
–db-name |
Transaction counting database name. |
–db-poll-interval |
OPTIONAL: Transaction counting database polling interval for reconnecting. Time in minutes. Default 5 minutes. |
Help
Configuration File
Log Configuration File
Host
Port
Url Path
PreFace Classifier Path
Concurrent Tasks
Queue Size
Certificate
Password
Enable CORS
CORS ACAO Policy
CORS ACAC Policy
CORS ACEH Policy
CORS ACMA Policy
CORS ACAM Policy
CORS ACAH Policy
Endpoint Decryption Key
Password Encryption
Password Decryption IV
Password Decryption Key
DB Host
DB User
DB Password
DB Name
DB Poll Interval
Server Log Configuration
The logging can be controlled by the parameters specified in the preface_log_config.ini file.
This file defines what will be logged to the console and what will be logged to the log file. The default log configuration is set to roll over monthly.
The formatting options (i.e. [%-5p][%d] %m%n) in the Knomi logging configuration file are defined by the log4cplus library. See (Logging configuration example
).
# MyConsoleAppender
log4cplus.appender.MyConsoleAppender=log4cplus::ConsoleAppender
log4cplus.appender.MyConsoleAppender.layout=log4cplus::PatternLayout
log4cplus.appender.MyConsoleAppender.layout.ConversionPattern=[%-5p][%d] %m%n
# InfoLogAppender
log4cplus.appender.InfoLogAppender=log4cplus::DailyRollingFileAppender
log4cplus.appender.InfoLogAppender.File=./knomi_face_analyzer_info.txt
log4cplus.appender.InfoLogAppender.layout=log4cplus::PatternLayout
log4cplus.appender.InfoLogAppender.layout.ConversionPattern=[%-5p][%d] %m%n
log4cplus.appender.InfoLogAppender.Schedule=MONTHLY
log4cplus.appender.InfoLogAppender.RollOnClose=false
# JsonAppender
log4cplus.appender.JsonAppender=log4cplus::DailyRollingFileAppender
log4cplus.appender.JsonAppender.File=./knomi_face_analyzer_stats.js
log4cplus.appender.JsonAppender.layout=log4cplus::PatternLayout
log4cplus.appender.JsonAppender.layout.ConversionPattern=%m%n
log4cplus.appender.JsonAppender.Schedule=MONTHLY
log4cplus.appender.JsonAppender.RollOnClose=false
log4cplus.logger.aw_knomi_face_analyzer_rest_server_info=INFO, MyConsoleAppender, InfoLogAppender
log4cplus.logger.aw_knomi_face_analyzer_rest_server_stats=INFO, MyConsoleAppender, JsonAppender