Skip to content

Commit 761f297

Browse files
committed
docs: add logging to README.md
1 parent 89c9e57 commit 761f297

1 file changed

Lines changed: 42 additions & 1 deletion

File tree

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Tools like [Lombok](https://projectlombok.org/) are used to reduce boilerplate c
2525
- [Spring Data JPA](https://spring.io/projects/spring-data-jpa) as ORM
2626
- [PostgreSQL](https://www.postgresql.org/) as DBMS
2727
- [Lombok](https://projectlombok.org/) for boilerplate code reduction
28+
- [Log4j 2](https://logging.apache.org/log4j/2.x/) for logging
2829
- Unit testing:
2930
- [JUnit](https://junit.org/junit5/) as testing framework
3031
- [AssertJ](https://assertj.github.io/doc/) for assertions
@@ -130,7 +131,7 @@ The following are lists of conventions that either *should* be followed or *must
130131
- [equals()/hashCode()](https://projectlombok.org/features/EqualsAndHashCode)
131132
- [Constructors](https://projectlombok.org/features/constructor)
132133
- [Builders](https://projectlombok.org/features/Builder) including with [inheritance](https://projectlombok.org/features/experimental/SuperBuilder)
133-
- [Loggers](https://projectlombok.org/features/log)
134+
- [Loggers](https://projectlombok.org/features/log): preferred is `@Log4j2`
134135
- [Utilities](https://projectlombok.org/features/experimental/UtilityClass)
135136
- [Exceptions](https://projectlombok.org/features/experimental/StandardException)
136137
- Can be used to set access levels of methods ([Getters/Setters](https://projectlombok.org/features/GetterSetter) and [Constructors](https://projectlombok.org/features/constructor))
@@ -147,3 +148,43 @@ The following are lists of conventions that either *should* be followed or *must
147148
- features: `feature/<ticket-number>_<short-description>`
148149
- bugs: `bugfix/<ticket-number>_<short-description>`
149150
- Commit messages are written according to [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
151+
152+
### Logging
153+
with [Log4j 2](https://logging.apache.org/log4j/2.x/)
154+
155+
<table>
156+
<thead>
157+
<tr>
158+
<th>Level</th>
159+
<th>Usage</th>
160+
</tr>
161+
</thead>
162+
<tbody>
163+
<tr>
164+
<td>Trace</td>
165+
<td>Trace events are used for extremely fine-grained diagnostic information, which can be helpful for tracking down very specific issues or understanding the detailed flow of a program.</td>
166+
</tr>
167+
<tr>
168+
<td>Debug</td>
169+
<td>Debug is used for internal system events that are not necessarily observable from the outside, but useful when determining how something happened.</td>
170+
</tr>
171+
<tr>
172+
<td>Info</td>
173+
<td>Information events describe things happening in the system that correspond to its responsibilities and functions.</td>
174+
</tr>
175+
<tr>
176+
<td>Warn</td>
177+
<td>When service is degraded, endangered, or maybe behaving outside its expected parameters, Warning-level events are used.</td>
178+
</tr>
179+
<tr>
180+
<td>Error</td>
181+
<td>When functionality is unavailable or expectations are broken, an Error event is used.</td>
182+
</tr>
183+
<tr>
184+
<td>Fatal</td>
185+
<td>The most critical level, Fatal events demand immediate attention.</td>
186+
</tr>
187+
</tbody>
188+
</table>
189+
190+
Usage guidelines are taken from [here](https://github.com/solid-stack-solutions/voycar-backend/blob/main/README.md#logging).

0 commit comments

Comments
 (0)