Skip to content

Commit

Permalink
Merge pull request #10 from amitdoiphode11/dev
Browse files Browse the repository at this point in the history
Dev to master
  • Loading branch information
amitdoiphode11 authored May 11, 2022
2 parents c913d4a + 8f3f0a7 commit 5ea2f72
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.7</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.6.2</version>
</dependency>
</dependencies>

<build>
Expand Down
25 changes: 25 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,28 @@ spring:
on-profile: prod
welcome:
message: Welcome to Daily Code Buffer!!


---

management:
endpoint:
health:
enabled: true
show-details: always
endpoints:
web:
exposure:
include: '*'
jmx:
exposure:
include: '*'
---
info:
app:
name: @project.name@
description: @project.description@
version: @project.version@
encoding: @project.build.sourceEncoding@
java:
version: @java.version@
65 changes: 65 additions & 0 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<property name="LOG_FILE" value="logs/app.log"/>

<appender name="FILE-ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_FILE}</file>

<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>logs/archived/app.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!-- each archived file, size max 5KB -->
<maxFileSize>5KB</maxFileSize>
<!-- total size of all archive files, if total size > 20KB,
it will delete old archived file -->
<totalSizeCap>20KB</totalSizeCap>
<!-- 60 days to keep -->
<maxHistory>60</maxHistory>
</rollingPolicy>

<encoder>
<pattern>%d %p %c{1.} [%t] %m%n</pattern>
</encoder>
</appender>

<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n
</Pattern>
</layout>
</appender>


<appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
<smtpHost>smtp.gmail.com</smtpHost>
<smtpPort>587</smtpPort>
<STARTTLS>true</STARTTLS>
<username>senderMail@gmail.com</username>
<password>senderMailPassword</password>
<to>test@gmail.com</to>
<from>senderMail@gmail.com</from>
<subject>DCBApp: %logger{20} - %m</subject>
<layout class="ch.qos.logback.classic.html.HTMLLayout"/>
</appender>

<logger name="com.eaglesoft" level="error" additivity="false">
<appender-ref ref="EMAIL"/>
</logger>

<logger name="com.eaglesoft" level="trace" additivity="false">
<appender-ref ref="FILE-ROLLING"/>
</logger>

<root level="error">
<appender-ref ref="FILE-ROLLING"/>
</root>

<logger name="com.eaglesoft" level="debug" additivity="false">
<appender-ref ref="CONSOLE"/>
</logger>
<root level="error">
<appender-ref ref="CONSOLE"/>
</root>

</configuration>

0 comments on commit 5ea2f72

Please sign in to comment.