-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use plugin and dependency management aliases; add logging config Replaced explicit plugin and dependency definitions with version catalog aliases for better maintainability. Introduced centralized logging configuration leveraging `Logback`, including JSON encoding for production. Updated `Dockerfile` to include `Datadog` setup and refined build tasks to improve deployment consistency.
- Loading branch information
1 parent
1a89b82
commit 21b733f
Showing
6 changed files
with
101 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration> | ||
<springProfile name="!prod"> | ||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/> | ||
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/> | ||
<root level="info"> | ||
<appender-ref ref="CONSOLE"/> | ||
</root> | ||
</springProfile> | ||
<springProfile name="prod"> | ||
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder"> | ||
<providers> | ||
<timestamp> | ||
<timeZone>UTC</timeZone> | ||
</timestamp> | ||
<loggerName/> | ||
<logLevel> | ||
<fieldName>status</fieldName> | ||
</logLevel> | ||
<threadName/> | ||
<stackTrace/> | ||
<message/> | ||
<nestedField> | ||
<fieldName>mdc</fieldName> | ||
<providers> | ||
<mdc/> | ||
</providers> | ||
</nestedField> | ||
<throwableClassName/> | ||
</providers> | ||
</encoder> | ||
</appender> | ||
<root level="info"> | ||
<appender-ref ref="stdout"/> | ||
</root> | ||
</springProfile> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
FROM openjdk:17 | ||
|
||
COPY --from=datadog/serverless-init:1 /datadog-init /app/datadog-init | ||
ADD 'https://dtdg.co/latest-java-tracer' /dd_tracer/java/dd-java-agent.jar | ||
|
||
ARG DD_VERSION=1 | ||
|
||
ENV DD_SERVICE=app-server | ||
ENV DD_ENV=prod | ||
ENV DD_VERSION=$DD_VERSION | ||
|
||
EXPOSE 8080 | ||
|
||
ENV ENV_PROFILE=prod | ||
ARG JAR_FILE=app-server/build/libs/app-server.jar | ||
COPY ${JAR_FILE} app.jar | ||
|
||
ENTRYPOINT ["java","-jar", "-Dspring.profiles.active=${ENV_PROFILE}", "/app.jar"] | ||
ENTRYPOINT ["/app/datadog-init"] | ||
|
||
CMD ["java","-jar", "-Dspring.profiles.active=prod", "/app.jar"] |