pytorch / serve

Serve, optimize and scale PyTorch models in production
https://pytorch.org/serve/
Apache License 2.0
4.22k stars 860 forks source link

log4j2 metrics JsonLayout / QLogLayout logger broken #1488

Open lxning opened 2 years ago

lxning commented 2 years ago

Please have a look at FAQ's and Troubleshooting guide, your query may be already addressed.

Your issue may already be reported! Please search on the issue tracker before creating one.

Context

Your Environment

Expected Behavior

See doc

Current Behavior

got the following error after setting jsonlayout in frontend/server/src/main/resources/log4j2.xml ` <RollingFile name="ts_metrics" fileName="${env:METRICS_LOCATION:-logs}/ts_metrics.log" filePattern="${env:METRICS_LOCATION:-logs}/ts_metrics.%d{dd-MMM}.log.gz">

        <Policies>
            <SizeBasedTriggeringPolicy size="100 MB"/>
            <TimeBasedTriggeringPolicy/>
        </Policies>
        <DefaultRolloverStrategy max="5"/>
    </RollingFile>

`

ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.layout.JsonLayout for element JSONLayout: java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.layout.JsonLayout java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.layout.JsonLayout

Current Behavior

Possible Solution

Steps to Reproduce

1. 2. ...

Failure Logs [if any]

badalrocks commented 2 years ago

we need this fix too. we would like to see logs in json format for easier analytics.

flibustier7seas commented 1 month ago

Any updates?