Skip to content

Commit 51aeeb6

Browse files
committed
Switch to SL4j.
1 parent 7ef992c commit 51aeeb6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/co/zeroae/gate/App.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
import gate.corpora.DocumentImpl;
1414
import gate.util.GateException;
1515
import gate.util.persistence.PersistenceManager;
16-
import org.apache.log4j.LogManager;
17-
import org.apache.log4j.Logger;
16+
import org.slf4j.Logger;
17+
import org.slf4j.LoggerFactory;
1818

1919
import java.io.ByteArrayOutputStream;
2020
import java.io.File;
@@ -46,7 +46,7 @@ public class App implements RequestHandler<APIGatewayProxyRequestEvent, APIGatew
4646
"CACHE_DIR_PREFIX", "/tmp/lru/" + GATE_APP_NAME);
4747
private static final double CACHE_DIR_USAGE = .9;
4848
private static final String DIGEST_SALT = UUID.randomUUID().toString();
49-
private static final Logger logger = LogManager.getLogger(App.class);
49+
private static final Logger logger = LoggerFactory.getLogger(App.class);
5050
private static final CorpusController application = AWSXRay.createSegment(
5151
"Gate Load", App::loadApplication);
5252
private static final AppMetadata metadata = loadMetadata();
@@ -148,7 +148,7 @@ public APIGatewayProxyResponseEvent handleExecute(APIGatewayProxyRequestEvent in
148148
AWSXRay.endSubsegment();
149149
}
150150
} catch (GateException e) {
151-
logger.error(e);
151+
logger.error(e.getMessage(), e);
152152
AWSXRay.getCurrentSubsegmentOptional().ifPresent((segment -> segment.addException(e)));
153153
response.getHeaders().put("Content-Type", "application/json");
154154
return response.withStatusCode(400).withBody(Utils.asJson(
@@ -157,7 +157,7 @@ public APIGatewayProxyResponseEvent handleExecute(APIGatewayProxyRequestEvent in
157157
}}
158158
));
159159
} catch (IOException e) {
160-
logger.error(e);
160+
logger.error(e.getMessage(), e);
161161
AWSXRay.getCurrentSubsegmentOptional().ifPresent((segment -> segment.addException(e)));
162162
response.getHeaders().put("Content-Type", "application/json");
163163
return response.withStatusCode(406).withBody(Utils.asJson(

0 commit comments

Comments
 (0)