Not getting LoggerFactory as an import option for loggers | Adobe Higher Education
Skip to main content
Level 4
July 5, 2023
Beantwoord

Not getting LoggerFactory as an import option for loggers

  • July 5, 2023
  • 1 reactie
  • 1720 Bekeken

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;
Er kunnen geen reacties meer worden geplaatst op dit onderwerp.
Beste antwoord door goyalkritika

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

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

1 reactie

aanchal-sikka
Community Advisor
Community Advisor
July 5, 2023

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
Level 4
July 5, 2023

Did that. It couldn't resolve the issue.

goyalkritikaAuteurAntwoord
Level 4
July 5, 2023

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

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