Skip to content

Commit 60af348

Browse files
MonstrofilARolek
authored andcommitted
feat (logging): Add layer and map info to large tile size warning
* Added the map and layer values to the large tile size warning log. * Migrated the log to structured logging.
1 parent d906201 commit 60af348

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

server/handle_map_layer_zxy.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"net/http"
88
"strconv"
99
"strings"
10+
"log/slog"
1011

1112
"github.com/dimfeld/httptreemux"
1213
"github.com/go-spatial/geom"
@@ -226,7 +227,14 @@ func (req HandleMapLayerZXY) ServeHTTP(w http.ResponseWriter, r *http.Request) {
226227

227228
// check for tile size warnings
228229
if len(pbyte) > MaxTileSize {
229-
log.Infof("tile z:%v, x:%v, y:%v is rather large - %vKb", req.z, req.x, req.y, len(pbyte)/1024)
230+
slog.Default().Info("tile is rather large",
231+
slog.String("map", req.mapName),
232+
slog.String("layer", req.layerName),
233+
slog.Uint64("z", uint64(req.z)),
234+
slog.Uint64("x", uint64(req.x)),
235+
slog.Uint64("y", uint64(req.y)),
236+
slog.Int("size_kb", len(pbyte)/1024),
237+
)
230238
}
231239
}
232240

0 commit comments

Comments
 (0)