Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit d39374e0 authored by Natalia Szakiel's avatar Natalia Szakiel
Browse files

Merge branch 'feature/SIMPL-10278' into 'develop'

Feature/simpl 10278

See merge request !90
parents 5e7d98cd dc30a06e
No related branches found
No related tags found
2 merge requests!91Develop,!90Feature/simpl 10278
Pipeline #268287 passed
File added
# EUROPEAN UNION PUBLIC LICENCE v. 1.2
Refer to [licence description](https://eupl.eu/1.2/en/)
SIMPL is granting credits to open source projects referred in the CREDITS.pdf file.
\ No newline at end of file
......@@ -60,23 +60,20 @@ spec:
hostPath:
path: /var/lib/docker/containers
- name: config
secret:
secretName: filebeat-config
defaultMode: 0555
configMap:
name: filebeat-config
defaultMode: 0600
- name: filebeat-certs
secret:
secretName: filebeat-certs-secret-{{ .Release.Namespace }}
---
apiVersion: v1
kind: Secret
kind: ConfigMap
metadata:
name: filebeat-config
labels:
app: filebeat
type: Opaque
data:
filebeat.yml: |
{{ printf "%s\n%s" .Values.filebeat.input (tpl .Values.filebeat.output $ ) | b64enc | nindent 6 }}
{{ printf "%s\n%s" .Values.filebeat.input (tpl .Values.filebeat.output $ ) | nindent 6 }}
---
apiVersion: cert-manager.io/v1
kind: Certificate
......
......@@ -179,9 +179,9 @@ metadata:
name: logstash-{{ $.Values.logstash.beats.pipelines_group_name }}-{{ .name }}-config
data:
{{ .name }}.config: |
{{ tpl .input $ | nindent 6 }}
{{ tpl .filter $ | nindent 6 }}
{{ tpl .output $ | nindent 6 }}
{{- tpl .input $ | nindent 4 }}
{{- tpl .filter $ | nindent 4 }}
{{- tpl .output $ | nindent 4 }}
---
{{- end }}
apiVersion: networking.k8s.io/v1
......
......@@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file.
## [0.1.11] - 2025-02-12
### Fixed
- Fixed bug with empty values in logstash and filebeat configmaps
## [0.1.10] - 2025-01-20
### Changed
......
This diff is collapsed.
### Log4J wrapper
Repository: https://code.europa.eu/simpl/simpl-open/development/contract-billing/common_logging
1. Import in the project
To import into project add maven dependency:
```
<properties>
<simpl.common.logging.version>1.0.0-SNAPSHOT.39.1a139b97</simpl.common.logging.version>
</properties>
<dependency>
<groupId>eu.simpl</groupId>
<artifactId>SIMPL_COMMON_LOGGING</artifactId>
<version>${simpl.common.logging.version}</version>
</dependency>
and repository
<repositories>
<repository>
<id>gitlab-maven</id>
<url>${CI_API_V4_URL}/projects/897/packages/maven</url>
</repository>
</repositories>
```
2. Normal logging:
LOG.info("message");
```
{
"timestamp": "2024-08-20T06:20:12.201Z",
"level": "INFO",
"message": "Application started",
"thread": "main",
"logger": "eu.simpl.simpl_billing.SimplBillingApplication"
}
```
3. Log Http Message
import static eu.simpl.MessageBuilder.buildMessage;
```
LOG.info(buildMessage(HttpLogMessage.builder()
.msg("HTTP request")
.httpStatus("200")
.httpRequestSize("100")
.httpExecutionTime("100")
.user("user")
.build()));
```
Result:
```
{
"timestamp": "2024-08-19T10:32:54.801Z",
"level": "INFO",
"message":
{
"msg": "HTTP request",
"httpStatus": "200",
"httpRequestSize": "100",
"user": "user",
"httpExecutionTime": "100"
},
"thread": "main",
"logger": "eu.simpl.simpl_billing.SimplBillingApplication"
}
```
4. Custom log level BUSINESS
buildMessage method can not be used with slf4, normal logging yes, can be used with sl4j.
example usage:
```
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import static eu.simpl.MessageBuilder.buildMessage;
private static final Logger LOG = LogManager.getLogger(ClassToBeChanged.class);
LOG.log(Level.getLevel("BUSINESS"), buildMessage(LogMessage.builder()
.origin("origin_name")
.destination("destination_name")
.businessOperations(List.of("operation1", "operation2"))
.messageType(MessageType.RESPONSE)
.correlationId("correlation_id")
.httpStatus("200")
.user("user_name")
.msg("Example log message")
.build()));
```
Result:
```
{
"timestamp": "2024-08-12T12:43:18.437+0200",
"level": "BUSINESS",
"message":
{
"msg": "Network",
"messageType": "RESPONSE",
"businessOperations": "[operation1, operation2]",
"origin": "origin_name",
"httpStatus": "200",
"destination": "destination_name",
"correlationId": "correlation_id",
"user": "user_name"
},
"thread": "main",
"logger": "eu.simple.simpl_billing.SimplBillingApplication",
"httpRequestSize": "null",
"httpExecutionTime": "null"
}
```
\ No newline at end of file
PROJECT_VERSION_NUMBER="0.1.10"
PROJECT_VERSION_NUMBER="0.1.11"
export LOGSTASH_HOSTS="\${LOGSTASH_HOSTS}"
export ELASTIC_ELASTICSEARCH_ES_HOSTS="\${ELASTIC_ELASTICSEARCH_ES_HOSTS}"
export LOGSTASH_USER="\${LOGSTASH_USER}"
export LOGSTASH_PASSWORD="\${LOGSTASH_PASSWORD}"
export MONITORED_NAMESPACE="\${MONITORED_NAMESPACE}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment