diff --git a/README.md b/README.md index ea0a0dd..f78a50a 100644 --- a/README.md +++ b/README.md @@ -1496,13 +1496,17 @@ Extras: # Version Changes Control +v1.7.2 - 2022-08-01 +----------------------- +- parameter %referer% added into pages logs for hosts + v1.7.1 - 2022-07-03 ----------------------- - Separation of librarypath and library for all plugins (components, engines and plugins), to have a better control of plugin prexif and version v1.7.0 - 2022-06-29 ----------------------- -- global pluginprefix and hostname parameters added to the configuration .json files. Those parameters are needed when you run multiple instances of the xamboo based on the same directory/code, to compile and load all the .so plugins to avoid conflicts ( name as pluginprefix + "-" + hostame + "library.so." + serial ) +- global pluginprefix parameter added to the configuration .json files. This parameter is needed when you run multiple instances of the xamboo based on the same directory/code, to compile and load all the .so plugins to avoid conflicts ( name as pluginpath + pluginprefix + "-" + hostame + "library.so." + serial ) - Compiler enhanced to better log compiled code with elapsed time, library, output errors. v1.6.6 - 2021-12-02 diff --git a/components/log/log.go b/components/log/log.go index 220f52c..187655c 100644 --- a/components/log/log.go +++ b/components/log/log.go @@ -111,6 +111,7 @@ func buildLogParams(hw host.HostWriter) map[string]string { data["starttime"] = fmt.Sprint(req.StartTime) data["endtime"] = fmt.Sprint(req.Time) data["request"] = fmt.Sprint(req.Request) + data["referer"] = fmt.Sprint(req.Referer) data["method"] = fmt.Sprint(req.Method) data["code"] = fmt.Sprint(req.Code) data["bytesout"] = fmt.Sprint(req.Length) diff --git a/components/stat/request.go b/components/stat/request.go index a235c82..4cd8dab 100644 --- a/components/stat/request.go +++ b/components/stat/request.go @@ -20,6 +20,7 @@ type RequestStat struct { Time time.Time Hostname string Request string + Referer string Protocol string Method string Code int @@ -102,7 +103,7 @@ func (s *MainStat) Clean() { } } -func CreateRequestStat(request string, method string, protocol string, code int, length int, duration time.Duration, remoteaddr string) *RequestStat { +func CreateRequestStat(request string, method string, protocol string, code int, length int, duration time.Duration, remoteaddr string, referer string) *RequestStat { ip, port, _ := net.SplitHostPort(remoteaddr) @@ -111,6 +112,7 @@ func CreateRequestStat(request string, method string, protocol string, code int, StartTime: time.Now(), Time: time.Now(), Request: request, + Referer: referer, Method: method, Protocol: protocol, Code: code, diff --git a/components/stat/stat.go b/components/stat/stat.go index 66b570b..d998fa7 100644 --- a/components/stat/stat.go +++ b/components/stat/stat.go @@ -46,7 +46,7 @@ func (st *Stat) Handler(handler http.HandlerFunc) http.HandlerFunc { lg.Println("C[stat]: We are going to create the statwriter.") } - req := CreateRequestStat(r.Host+r.URL.Path, r.Method, r.Proto, 0, 0, 0, r.RemoteAddr) + req := CreateRequestStat(r.Host+r.URL.Path, r.Method, r.Proto, 0, 0, 0, r.RemoteAddr, r.Referer()) req.Hostname = host.Name sw := writer{writer: hw, RequestStat: req} hw.SetParam("requeststat", req) diff --git a/xamboo.go b/xamboo.go index 236d633..0d2a4e7 100644 --- a/xamboo.go +++ b/xamboo.go @@ -26,4 +26,4 @@ package xamboo // VERSION last oficial published version of the xamboo on github.com -const VERSION = "1.7.1" +const VERSION = "1.7.2"