Hi everyone

I am not sure if this has been raised before, I tried checking the archives.

We have the same configuration path shared by several GeoServer (2.22.2) 
container instances that we are executing. This is acceptable for the shared 
configuration, but we want to split the logging for each instance into a 
distinct directory/file (or something similar) to prevent various instances' 
logs from overwriting each other. We are hoping to achieve this without 
customizing the Docker image (oscarfonts or osgeo). The hostnames keep changing 
every time the container instances are restarted, which presents an issue in 
this case.

A related issue: All containers are behind a single load balancer, which means 
that the browser connects to a random container's GUI and, depending on how it 
is configured, will possibly only return that container's logs (using the menu 
GeoServer Logs) rather than all containers' logs. On the load balancer, sticky 
sessions have been set up.

I have followed this guide. 
https://docs.geoserver.org/latest/en/user/configuration/logging.html#overriding-the-log-location-setup-in-the-geoserver-configuration

I tried the below:

GEOSERVER_LOG_LOCATION
Approach: I have tried creating a custom location and file before the container 
starts using a startup script, but the GeoServer Global GUI log setting only 
picks up locations that are inside the GEOSERVER_PATH.
Issue: I cannot create a custom location and file for each container inside 
GEOSERVER_PATH unless the Docker image is modified

Using Log4J property substitution in a .xml logging profile
Approach: This creates separate logs using the ${hostName} variable.
Issue:  The GeoServer logs GUI can't read the ${hostName} variable from the 
Global GUI log settings (logs/geoserver-${hostName}.log). If you explicitly put 
the container hostname (logs/geoserver-xxxxxxxx.log) in the Global GUI setting 
manually, then you can read the logs from the GeoServer logs GUI. This however 
won't work on the next container restart, as a new hostname will be generated, 
and you will have to manually update it.

ENV_PARAMETERS
Approach: I tried passing the hostName variable into the environment.properties 
file for the GUI to read.
Issue: The global GUI setting could not read the hostName variable that I tried 
to pass. I could be passing it incorrectly (geoserver_hostname = ${hostName}). 
We have tested ENV_PARAMETERS, and they worked for Proxy Base URL in Global GUI 
settings. It could be that environment.properties don't read variables?

I have not been able to find a similar use case when searching online.

Any advice would be greatly valued.


Regards

Nkosinathi Skhosana
IT | Senior Systems Administrator

Office
+27 87 310 6400

Mobile
 +27 78 438 5944





AfriGIS (Pty) Ltd
-25.808611  |  28.256111
Rigel Park, 446 Rigel Avenue S, Erasmusrand, Pretoria, South Africa
[cid:image001.png@01D958C3.4EF86930]



_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to