Issue Demo: Spring Boot + Log4j2 + Azure App Insights
- In the project's run directory, build project and copy built jar to the Docker workdir:
mvn clean package
cp target/demo-0.0.1-SNAPSHOT.jar docker/
- In the
docker
directory, build a local docker image with:
docker build -t azure/ai-demo:latest \
--build-arg JAR_FILE=demo-0.0.1-SNAPSHOT.jar \
--build-arg PORT=8081 \
--build-arg javaOpts="" \
--build-arg appInsightsConnStr="InstrumentationKey=..." \
.
- Run a new container locally, and check whether logs are pushed on App Insights:
docker run -a stdout --rm -p 8081:8081 azure/ai-demo:latest