Skip to content

Commit

Permalink
Modify the configuration file templates in drogon_ctl
Browse files Browse the repository at this point in the history
  • Loading branch information
an-tao committed Dec 5, 2023
1 parent 8026790 commit 358de6e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 21 deletions.
1 change: 0 additions & 1 deletion config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ app:
# log: Set log output, drogon output logs to stdout by default
log:
# use_spdlog: Use spdlog library to log
# use_spdlog: false
use_spdlog: false,
# log_path: Log file path,empty by default,in which case,logs are output to the stdout
# log_path: ./
Expand Down
56 changes: 36 additions & 20 deletions drogon_ctl/templates/config_json.csp
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@
"apk",
"cur",
"xml",
"svg",
"webp"
"webp",
"svg"
],
// mime: A dictionary that extends the internal MIME type support. Maps extensions into new MIME types
// note: This option only adds MIME to the sever. `file_types` above have to be set for the server to serve them.
Expand Down Expand Up @@ -214,6 +214,9 @@
},
//log: Set log output, drogon output logs to stdout by default
"log": {
//use_spdlog: Use spdlog library to log
//"use_spdlog": false
"use_spdlog": false,
//log_path: Log file path,empty by default,in which case,logs are output to the stdout
//"log_path": "./",
//logfile_base_name: Log file base name,empty by default which means drogon names logfile as
Expand Down Expand Up @@ -248,19 +251,19 @@
//0 means cache forever, the negative value means no cache
"static_files_cache_time": 5,
//simple_controllers_map: Used to configure mapping from path to simple controller
"simple_controllers_map": [
{
"path": "/path/name",
"controller": "controllerClassName",
"http_methods": [
"get",
"post"
],
"filters": [
"FilterClassName"
]
}
],
//"simple_controllers_map": [
// {
// "path": "/path/name",
// "controller": "controllerClassName",
// "http_methods": [
// "get",
// "post"
// ],
// "filters": [
// "FilterClassName"
// ]
// }
//],
//idle_connection_timeout: Defaults to 60 seconds, the lifetime
//of the connection without read or write
"idle_connection_timeout": 60,
Expand Down Expand Up @@ -311,16 +314,29 @@
"plugins": [
{
//name: The class name of the plugin
//"name": "drogon::plugin::SecureSSLRedirector",
"name": "drogon::plugin::PromExporter",
//dependencies: Plugins that the plugin depends on. It can be commented out
"dependencies": [],
//config: The configuration of the plugin. This json object is the parameter to initialize the plugin.
//It can be commented out
"config": {
"ssl_redirect_exempt": [
".*\\.jpg"
],
"secure_ssl_host": "localhost:8849"
"path": "/metrics"
}
},
{
"name": "drogon::plugin::AccessLogger",
"dependencies": [],
"config": {
"use_spdlog": false,
"log_path": "",
"log_format": "",
"log_file": "access.log",
"log_size_limit": 0,
"use_local_time": true,
"log_index": 0,
// "show_microseconds": true,
// "custom_time_format": "",
// "use_real_ip": false
}
}
],
Expand Down
2 changes: 2 additions & 0 deletions drogon_ctl/templates/config_yaml.csp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ app:
precision_type: significant
# log: Set log output, drogon output logs to stdout by default
log:
# use_spdlog: Use spdlog library to log
use_spdlog: false,
# log_path: Log file path,empty by default,in which case,logs are output to the stdout
# log_path: ./
# logfile_base_name: Log file base name,empty by default which means drogon names logfile as
Expand Down

0 comments on commit 358de6e

Please sign in to comment.