Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Not getting LoggerFactory as an import option for loggers

Avatar

Level 5

I'm working on a util class. And trying to put a logger in it. But import logger from LoggerFactory is not appearing in the import list. What can be causing this issue as the same import is available in another file as an import. So, dependency is not an issue in this case.

Below are the imports I'm talking about.

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
1 Accepted Solution

Avatar

Correct answer by
Level 5

The issue was the I was not initiating the variable itself. My bad.

private static final Logger LOGGER = LoggerFactory.getLogger(SessionManagementUtils.class);

View solution in original post

3 Replies

Avatar

Community Advisor

hello @goyalkritika 

 

Can you please try by creating a fresh workspace? Something might be corrupted.

- Commit the file

- Take a latest pull of the code in separate folder

- Import project in IDE and check


Aanchal Sikka

Avatar

Correct answer by
Level 5

The issue was the I was not initiating the variable itself. My bad.

private static final Logger LOGGER = LoggerFactory.getLogger(SessionManagementUtils.class);