Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support reading log properties from file #340

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,15 @@ configuration YAML file.

Find more information in the [routing rules documentation](routing-rules.md).


### Configure logging <a name="logging">

Path to `log.properties` must be set via `log.levels-file` JVM options
like `-Dlog.levels-file=etc/log.properties`.
To configure the logging level for various classes, specify the path to the
`log.properties` file using the `log.levels-file` JVM options, such as
`-Dlog.levels-file=etc/log.properties`, when the logging type is `external`.

Use the `log.*` properties from the [Trino logging properties
documentation](https://trino.io/docs/current/admin/properties-logging.html) for further configuration.
For additional configurations, use the `log.*` properties from the
[Trino logging properties documentation](https://trino.io/docs/current/admin/properties-logging.html) and specify the path to `config.properties`
file using the `config` JVM options, such as `-Dconfig=var/config.properties`.

### Proxying additional paths

Expand Down
4 changes: 4 additions & 0 deletions gateway-ha/etc/config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
% https://trino.io/docs/current/admin/properties-logging.html
log.max-size=100MB
log.max-total-size=1GB
log.compression=GZIP
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import java.util.Map;

import static io.airlift.configuration.ConfigurationLoader.getSystemProperties;
import static io.airlift.configuration.ConfigurationLoader.loadProperties;

public class HaGatewayLauncher
extends BaseApp
Expand All @@ -40,7 +40,7 @@ public static void main(String[] args)
throws Exception
{
Logging.initialize();
Map<String, String> properties = getSystemProperties();
Map<String, String> properties = loadProperties();
ConfigurationFactory configurationFactory = new ConfigurationFactory(properties);
LoggingConfiguration configuration = configurationFactory.build(LoggingConfiguration.class);
Logging logging = Logging.initialize();
Expand Down