Skip to content

chore: Make request for Logger explicitly for current class #1307

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

Merged
merged 2 commits into from
Jul 26, 2023
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
18 changes: 9 additions & 9 deletions docs/core/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ to customise what is logged.
*/
public class App implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {

Logger log = LogManager.getLogger();
Logger log = LogManager.getLogger(App.class);

@Logging
public APIGatewayProxyResponseEvent handleRequest(final APIGatewayProxyRequestEvent input, final Context context) {
Expand All @@ -256,7 +256,7 @@ to customise what is logged.
*/
public class AppLogEvent implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {

Logger log = LogManager.getLogger();
Logger log = LogManager.getLogger(AppLogEvent.class);

@Logging(logEvent = true)
public APIGatewayProxyResponseEvent handleRequest(final APIGatewayProxyRequestEvent input, final Context context) {
Expand Down Expand Up @@ -315,7 +315,7 @@ You can set a Correlation ID using `correlationIdPath` attribute by passing a [J
*/
public class App implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {

Logger log = LogManager.getLogger();
Logger log = LogManager.getLogger(App.class);

@Logging(correlationIdPath = "/headers/my_request_id_header")
public APIGatewayProxyResponseEvent handleRequest(final APIGatewayProxyRequestEvent input, final Context context) {
Expand Down Expand Up @@ -364,7 +364,7 @@ for known event sources, where either a request ID or X-Ray Trace ID are present
*/
public class App implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {

Logger log = LogManager.getLogger();
Logger log = LogManager.getLogger(App.class);

@Logging(correlationIdPath = CorrelationIdPathConstants.API_GATEWAY_REST)
public APIGatewayProxyResponseEvent handleRequest(final APIGatewayProxyRequestEvent input, final Context context) {
Expand Down Expand Up @@ -417,7 +417,7 @@ You can append your own keys to your existing logs via `appendKey`.
*/
public class App implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {

Logger log = LogManager.getLogger();
Logger log = LogManager.getLogger(App.class);

@Logging(logEvent = true)
public APIGatewayProxyResponseEvent handleRequest(final APIGatewayProxyRequestEvent input, final Context context) {
Expand Down Expand Up @@ -449,7 +449,7 @@ You can remove any additional key from entry using `LoggingUtils.removeKeys()`.
*/
public class App implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {

Logger log = LogManager.getLogger();
Logger log = LogManager.getLogger(App.class);

@Logging(logEvent = true)
public APIGatewayProxyResponseEvent handleRequest(final APIGatewayProxyRequestEvent input, final Context context) {
Expand Down Expand Up @@ -484,7 +484,7 @@ this means that custom keys can be persisted across invocations. If you want all
*/
public class App implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {

Logger log = LogManager.getLogger();
Logger log = LogManager.getLogger(App.class);

@Logging(clearState = true)
public APIGatewayProxyResponseEvent handleRequest(final APIGatewayProxyRequestEvent input, final Context context) {
Expand Down Expand Up @@ -545,7 +545,7 @@ specific fields from received event due to security.
*/
public class App implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {

Logger log = LogManager.getLogger();
Logger log = LogManager.getLogger(App.class);

static {
ObjectMapper objectMapper = new ObjectMapper();
Expand Down Expand Up @@ -575,7 +575,7 @@ via `samplingRate` attribute on annotation.
*/
public class App implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {

Logger log = LogManager.getLogger();
Logger log = LogManager.getLogger(App.class);

@Logging(samplingRate = 0.5)
public APIGatewayProxyResponseEvent handleRequest(final APIGatewayProxyRequestEvent input, final Context context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import static software.amazon.lambda.powertools.parameters.transform.Transformer.json;

public class ParametersFunction implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {
private final static Logger log = LogManager.getLogger();
private final static Logger log = LogManager.getLogger(ParametersFunction.class);

SSMProvider ssmProvider = ParamManager.getSsmProvider();
SecretsProvider secretsProvider = ParamManager.getSecretsProvider();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.stream.Collectors;

public class IdempotencyFunction implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {
private final static Logger LOG = LogManager.getLogger();
private final static Logger LOG = LogManager.getLogger(IdempotencyFunction.class);

public boolean handlerExecuted = false;

Expand Down