File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ type Config struct {
1616 FpmPath string `mapstructure:"fpm"`
1717 FpmConfigPath string `mapstructure:"fpm-config"`
1818
19- FpmSlowlogProxyDisabled bool `mapstructure:"fpm-no-slowlog"`
19+ FpmNoErrlogProxy bool `mapstructure:"fpm-no-errlog"`
20+ FpmNoSlowlogProxy bool `mapstructure:"fpm-no-slowlog"`
2021
2122 // Logging proxy section
2223 WrapperSocket string `mapstructure:"wrapper-socket"`
@@ -35,6 +36,8 @@ func parseCommandLineFlags() {
3536
3637 pflag .StringP ("fpm" , "f" , "" , "path to php-fpm" )
3738 pflag .StringP ("fpm-config" , "c" , "/etc/php/php-fpm.conf" , "path to php-fpm config file" )
39+
40+ pflag .Bool ("fpm-no-errlog" , false , "Disable php-fpm errlog parsing and proxy" )
3841 pflag .Bool ("fpm-no-slowlog" , false , "Disable php-fpm slowlog parsing and proxy" )
3942
4043 // Logging proxy section
Original file line number Diff line number Diff line change @@ -72,13 +72,16 @@ func main() {
7272 os .Exit (1 )
7373 }
7474
75- if err := startErrLogProxy (ctx , log .Named ("php-fpm" ), fpmConfig .ErrorLog ); err != nil {
76- log .Error ("can't start err_log proxy" , zap .Error (err ))
75+ if false == cfg .FpmNoErrlogProxy {
76+ if err := startErrLogProxy (ctx , log .Named ("php-fpm" ), fpmConfig .ErrorLog ); err != nil {
77+ log .Error ("can't start err_log proxy" , zap .Error (err ))
78+ os .Exit (1 )
79+ }
7780 }
7881
79- if ! cfg .FpmSlowlogProxyDisabled {
82+ if false == cfg .FpmNoSlowlogProxy {
8083 if err = startSlowlogProxies (ctx , log .Named ("php-fpm" ), fpmConfig .Pools ); err != nil {
81- log .Fatal ("Can't start slowlog proxies" , zap .Error (err ))
84+ log .Error ("Can't start slowlog proxies" , zap .Error (err ))
8285 os .Exit (1 )
8386 }
8487 }
You can’t perform that action at this time.
0 commit comments