[
    %% 游戏服配置
    {game_server, [
        {server_type, game_server},
        {platform_zone, 0},
        {tcp_port, ${tcp_port}},
        {http_port, ${http_port}},
        {server_id, ${server_id}},
        {server_name, "${server_name}"},
        {main_platform, "android_cn"},
        {merge_server_ids, ${merge_server_ids}},
        {login_node, '${login_node}'},
        {center_node, '${center_node}'},
        {open_time, ${open_time}},
        {gm_auth, ${gm_auth}},
        {is_develop, ${is_develop}},
        {is_inner, ${is_inner}},
        {is_mainland, true},
        {auto_reload, ${auto_reload}},
        {game_host, "${game_host}"},
        {game_tcp_port, ${game_tcp_port}},
        {role_log, "${role_log}"},
        {risk_control_server_ip, "${risk_control_server_ip}"},
        {risk_control_server_post, ${risk_control_server_post}},

        %% 日志文件配置
        {logger, [
            {handler, info, ms_logger_std, #{
                level => info,
                config => #{
                    file => "${log_dir}/info.log",
                    burst_limit_enable => true,
                    burst_limit_max_count => 500,
                    burst_limit_window_time => 1000,
                    sync_mode_qlen => 200,
                    drop_mode_qlen => 200,
                    flush_qlen => 1000,
                    max_no_bytes => 209715200,
                    max_no_files => 10
                },
                filter_default => stop,
                filters => [
                    {domain, {fun logger_filters:domain/2, {log, equal, [ms_base]}}}
                ],
                formatter => {logger_formatter, #{
                    max_size => 2000,
                    single_line => false,
                    legacy_header => false,
                    template => ["====| ", time, " | ", level, " | ", {id, [id], ["undefined"]}, " | ", mfa, ":", line, " | ", pid, " |====\n", msg, "\n"]
                }}
            }},

            {handler, error, ms_logger_std, #{
                level => error,
                config => #{
                    file => "${log_dir}/error.log",
                    burst_limit_enable => true,
                    burst_limit_max_count => 500,
                    burst_limit_window_time => 1000,
                    sync_mode_qlen => 200,
                    drop_mode_qlen => 200,
                    flush_qlen => 1000,
                    max_no_bytes => 209715200,
                    max_no_files => 10
                },
                filter_default => stop,
                filters => [
                    {domain, {fun logger_filters:domain/2, {log, equal, [ms_base]}}}
                ],
                formatter => {logger_formatter, #{
                    max_size => 10000,
                    single_line => false,
                    legacy_header => false,
                    template => ["====| ", time, " | ", level, " | ", {id, [id], ["undefined"]}, " | ", mfa, ":", line, " | ", pid, " |====\n", msg, "\n"]
                }}
            }},

            {handler, http_log, ms_logger_std, #{
                level => info,
                config => #{
                    file => "${log_dir}/http_info.log",
                    burst_limit_enable => true,
                    burst_limit_max_count => 500,
                    burst_limit_window_time => 1000,
                    sync_mode_qlen => 200,
                    drop_mode_qlen => 200,
                    flush_qlen => 1000,
                    max_no_bytes => 209715200,
                    max_no_files => 10
                },
                filter_default => stop,
                filters => [
                    {http_domain, {fun logger_filters:domain/2, {log, equal, [ms_http]}}}
                ],
                formatter => {logger_formatter, #{
                    max_size => 10000,
                    single_line => false,
                    legacy_header => false,
                    template => ["====| ", time, " | ", level, " | ", {id, [id], ["undefined"]}, " | ", mfa, ":", line, " | ", pid, " |====\n", msg, "\n"]
                }}
            }}
        ]}
    ]},

    %% ms_cache 缓存配置
    {ms_cache, [
        {data_node, undefined},
        {cache_db_type, ets},
        {data_fmt, record},
        {table_worker_count, 8},
        {db_save_time, ${db_save_time}},
        {db_save_count, ${db_save_count}},
        {db_driver, 'mysql-otp'},
        {db_user, "${db_user}"},
        {db_pass, "${db_pass}"},
        {db_host, "${db_host}"},
        {db_port, ${db_port}},
        {db_name, "${db_game_name}"},
        {db_encoding, utf8},
        {db_select_pool_name, select_pool_name},
        {db_select_pool_size, 32},
        {db_select_pool_overflow, 128},
        {db_update_pool_name, update_pool_name},
        {db_update_pool_size, 10},
        {db_sync_options, #{
            create_table => true,
            drop_table => false,
            alter_table => true,
            patch_run_mod => auto,
            patch_prefix => "patch_",
            limit => 7
        }}
    ]},

    %% ms_tbllog 后台日志配置
    {ms_tbllog, [
        {data_node, undefined},
        {data_fmt, record},
        {db_save_start_time, 60000},
        {db_save_time, ${log_save_time}},
        {db_save_count, ${log_save_count}},
        {db_driver, 'mysql-otp'},
        {db_user, "${db_user}"},
        {db_pass, "${db_pass}"},
        {db_host, "${db_host}"},
        {db_port, ${db_port}},
        {db_name, "${db_log_name}"},
        {db_encoding, utf8},
        {db_update_pool_name, tbllog_pool_name},
        {db_update_pool_size, 10}
    ]},

    %% kernel 配置
    {kernel, [
        {inet_dist_listen_min, 16000},
        {inet_dist_listen_max, 17000},
        {logger_level, ${logger_level}},
        {logger, [
            {filters, stop, [
                {domain, {fun logger_filters:domain/2, {log, equal, [ms_base]}}},
                {http_domain, {fun logger_filters:domain/2, {log, equal, [ms_http]}}}
            ]},
            {handler, default, logger_std_h, #{
                level => ${logger_level},
                filter_default => stop,
                filters => [{need_level, {fun logger_filters:level/2, {log, gteq, info}}}],
                formatter => {logger_formatter, #{
                    max_size => 10000,
                    single_line => false,
                    legacy_header => false,
                    template => ["====| ", time, " | ", level, " | ", {id, [id], ["undefined"]}, " | ", mfa, ":", line, " | ", pid, " |====\n", msg, "\n"]
                }}
            }}
        ]}
    ]},

    %% sasl 配置
    {sasl, [
        {sasl_error_logger, false}
    ]}
].
