Java 中记录器信息存储在哪里?

Where the Logger info stored in Java?

在这段代码中,记录的信息存储在哪里(即"Needed parameters: ")?

它在我项目的某个文件中吗?

import org.slf4j.Logger;

public static void main(String[] args) throws Exception {
    if (args.length != 2) {
        logger.info("Needed parameters: ");
        logger.info("\t rootFolder (it will contain intermediate crawl data)");
        logger.info("\t numberOfCralwers (number of concurrent threads)");
        return;
    }
    // ...
}

Where the Logger info stored in Java

通常,它被写入一个文件。但是,这取决于您如何配置底层记录器实现。

请注意,您的示例代码(很可能)是对日志记录的不正确/不当使用。它似乎在编写用户需要查看的错误消息;即当他们得到错误的命令行参数时。针对最终用户的错误消息应写入 "standard error"(或可能 "standard output")。一般来说,用户不知道查看日志文件。