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

[FEATURE] Support advanced logging controls for Lambda functions #2409

Open
sergei-ivanov opened this issue Nov 19, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@sergei-ivanov
Copy link

Is your feature request related to a problem? If yes, please describe.

Lambda function configuration now allows setting log level and switch between plain text and JSON logging. But unfortunately it's not currently being handled by the federation connectors. If I configure JSON logging, only Lambda runtime picks up that configuration. The connector still logs in plain text.

Describe the solution you'd like

Update Log4j2 configuration for all connectors according to the AWS guide.

For example, the logging configuration for Athena connector should be changed to:

<Configuration packages="com.amazonaws.services.lambda.runtime.log4j2">
    <Appenders>
        <Lambda name="Lambda" format="${env:AWS_LAMBDA_LOG_FORMAT:-TEXT}">
            <LambdaTextFormat>
                <PatternLayout>
                    <pattern>%d{yyyy-MM-dd HH:mm:ss} %X{AWSRequestId} %-5p %c{1} - %m%n </pattern>
                </PatternLayout>
            </LambdaTextFormat>
            <LambdaJSONFormat>
                <JsonTemplateLayout eventTemplateUri="classpath:LambdaLayout.json" />
            </LambdaJSONFormat>
        </Lambda>
    </Appenders>
    <Loggers>
        <Logger name="com.amazonaws.athena.connector.lambda" level="${env:ATHENA_FEDERATION_SDK_LOG_LEVEL:-warn}" />
        <Logger name="com.amazonaws.athena.connectors.postgresql" level="${env:ATHENA_FEDERATION_SDK_LOG_LEVEL:-warn}" />
        <Root level="${env:AWS_LAMBDA_LOG_LEVEL:-INFO}">
            <AppenderRef ref="Lambda" />
        </Root>
    </Loggers>
</Configuration>

Describe alternatives you've considered
N/A

Additional context
N/A

@sergei-ivanov sergei-ivanov added the enhancement New feature or request label Nov 19, 2024
@macohen
Copy link
Contributor

macohen commented Dec 11, 2024

@sergei-ivanov would you be up to submitting this as a PR? good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants