Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

88 log current step name being executed #91

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Product user version : 7.0

Note: _The 'Product user version' is a value that you set in the environment variables, and is intended for the consumers._

## Testing That all External Dervices can be Accessed
## Testing That all External Devices can be Accessed
One of the added values of this service is to create a single point of access for external dependencies. However, this needs to be checked, before using this service. In order to do this you need to the following POST call:

```
Expand Down
3 changes: 3 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Bridge Service - RELEASE NOTES

## 2.11.16-SNAPSHOT
* [#88 Logging action steps](https://github.com/adobe/bridgeService/issues/88). We now log the steps we take during execution for better debugging.

## 2.11.15
* [#71 Adding step name when throwing exceptions](https://github.com/adobe/bridgeService/issues/71). When an exception happens, include the step in which it occurred.
* [#72 Provide the stack trace of the root cause of the errors](https://github.com/adobe/bridgeService/issues/72). With issue #9 we discovered that the stack trace should be that of the original cause.
Expand Down
28 changes: 14 additions & 14 deletions diagrams/Processes.drawio
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<mxfile host="Electron" modified="2024-03-17T10:39:06.421Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.5.0 Chrome/112.0.5615.204 Electron/24.5.1 Safari/537.36" etag="m42KBoyM5yT4HIk-JTHs" version="21.5.0" type="device" pages="7">
<mxfile host="Electron" modified="2024-03-20T16:02:44.705Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.5.0 Chrome/112.0.5615.204 Electron/24.5.1 Safari/537.36" etag="T8k0m3VboXX1Qf9j5F7k" version="21.5.0" type="device" pages="7">
<diagram id="U-Ol1gjGJqWnEwxZnstw" name="injectionModel">
<mxGraphModel dx="1354" dy="878" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
Expand Down Expand Up @@ -91,7 +91,7 @@
</mxGraphModel>
</diagram>
<diagram id="oyOZ0VpPzgVrcxhvQpzn" name="System">
<mxGraphModel dx="1354" dy="878" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<mxGraphModel dx="1114" dy="878" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
Expand Down Expand Up @@ -150,47 +150,47 @@
</mxGraphModel>
</diagram>
<diagram id="CHwbht-fYn5J0x3HK4nq" name="IntegrityRules">
<mxGraphModel dx="1354" dy="878" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<mxGraphModel dx="1114" dy="878" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="piZtFrCOIWojtAoRM34y-6" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="piZtFrCOIWojtAoRM34y-1" target="piZtFrCOIWojtAoRM34y-5">
<mxCell id="piZtFrCOIWojtAoRM34y-6" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="piZtFrCOIWojtAoRM34y-1" target="piZtFrCOIWojtAoRM34y-5" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="piZtFrCOIWojtAoRM34y-7" value="yes" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="piZtFrCOIWojtAoRM34y-6">
<mxCell id="piZtFrCOIWojtAoRM34y-7" value="yes" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="piZtFrCOIWojtAoRM34y-6" vertex="1" connectable="0">
<mxGeometry x="0.1647" y="2" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="piZtFrCOIWojtAoRM34y-9" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="piZtFrCOIWojtAoRM34y-1" target="piZtFrCOIWojtAoRM34y-11">
<mxCell id="piZtFrCOIWojtAoRM34y-9" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="piZtFrCOIWojtAoRM34y-1" target="piZtFrCOIWojtAoRM34y-11" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="320" y="400" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="piZtFrCOIWojtAoRM34y-10" value="no" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="piZtFrCOIWojtAoRM34y-9">
<mxCell id="piZtFrCOIWojtAoRM34y-10" value="no" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="piZtFrCOIWojtAoRM34y-9" vertex="1" connectable="0">
<mxGeometry x="-0.3111" y="-1" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="piZtFrCOIWojtAoRM34y-1" value="isGenerous?" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="piZtFrCOIWojtAoRM34y-1" value="isGenerous?" style="rhombus;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="280" y="230" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="piZtFrCOIWojtAoRM34y-4" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="piZtFrCOIWojtAoRM34y-3" target="piZtFrCOIWojtAoRM34y-1">
<mxCell id="piZtFrCOIWojtAoRM34y-4" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="piZtFrCOIWojtAoRM34y-3" target="piZtFrCOIWojtAoRM34y-1" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="piZtFrCOIWojtAoRM34y-3" value="Call Arrives" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="piZtFrCOIWojtAoRM34y-3" value="Call Arrives" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="60" y="240" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="piZtFrCOIWojtAoRM34y-5" value="load all accessed classed" style="whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="piZtFrCOIWojtAoRM34y-5" value="load all accessed classed" style="whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="530" y="240" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="piZtFrCOIWojtAoRM34y-13" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="piZtFrCOIWojtAoRM34y-11" target="piZtFrCOIWojtAoRM34y-12">
<mxCell id="piZtFrCOIWojtAoRM34y-13" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="piZtFrCOIWojtAoRM34y-11" target="piZtFrCOIWojtAoRM34y-12" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="piZtFrCOIWojtAoRM34y-11" value="Load only classes iin path" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="piZtFrCOIWojtAoRM34y-11" value="Load only classes iin path" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="260" y="380" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="piZtFrCOIWojtAoRM34y-12" value="load Called Classes?" style="rhombus;whiteSpace=wrap;html=1;rounded=0;" vertex="1" parent="1">
<mxCell id="piZtFrCOIWojtAoRM34y-12" value="load Called Classes?" style="rhombus;whiteSpace=wrap;html=1;rounded=0;" parent="1" vertex="1">
<mxGeometry x="280" y="510" width="80" height="80" as="geometry" />
</mxCell>
</root>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@
*/
package com.adobe.campaign.tests.bridge.service;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.ThreadContext;

import java.util.Optional;

public class LogManagement {
public static final String STD_CURRENT_STEP = "currentStep";
private static final Logger log = LogManager.getLogger();


/**
* Logs the step in the context. it will later be used by the Error Object to generate step info in the error
Expand All @@ -32,6 +36,7 @@ protected static void logStep(STD_STEPS in_state) {
* @param in_step A constant static field
*/
protected static void logStep(String in_step) {
log.info("About to perform step : {}", in_step);
ThreadContext.put(STD_CURRENT_STEP, in_step);
}

Expand Down
21 changes: 10 additions & 11 deletions integroBridgeService/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

<DefaultRolloverStrategy max="12">
<Delete basePath="ibs_output" maxDepth="2">
<IfFileName glob="logfile*.log.gz" >
<IfFileName glob="logfile*.log.gz">
<IfAny>
<IfAccumulatedFileSize exceeds="3GB" />
<IfLastModified age="P10D" />
<IfAccumulatedFileSize exceeds="3GB"/>
<IfLastModified age="P10D"/>
</IfAny>
</IfFileName>
</Delete>
Expand All @@ -39,12 +39,11 @@
</Appenders>


<Loggers>
<Root level="DEBUG">
<AppenderRef ref="RollingFile" level="DEBUG"/>
<AppenderRef ref="FILE" level="DEBUG"/>
<AppenderRef ref="STDOUT" level="INFO"/>
<!--You can set ref="STDOUT" level ="DEBUG" to allow all the logs in the console locally-->
</Root>
</Loggers>
<Loggers>
<Root level="DEBUG">
<AppenderRef ref="RollingFile" level="DEBUG"/>
<AppenderRef ref="STDOUT" level="INFO"/>
<!--You can set ref="STDOUT" level ="DEBUG" to allow all the logs in the console locally-->
</Root>
</Loggers>
</Configuration>
Loading