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.
The server provides the following startup arguments (Server Program Options
).
Note: The package you received may not contain server. Please contact Aware if you are interested in server.
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. |
–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. |
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