Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
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);