---
title: "shell下使用log4j 1.x “No appenders could be found for logger”问题两个处理办法"
author: "heipark"
date: "2018-05-25T23:25:44Z"
tags: []
categories: ["编程语言"]
slug: "shell-log4j-1-x-no-appenders-could-be-found-for-logger"
draft: false
lastmod: "2018-05-25T23:25:44Z"
id: 2423617
url: "https://heipark.iteye.com/blog/2423617"
---

错误：

log4j:WARN No appenders could be found for logger (org.apache.flink.core.fs.FileSystem).

log4j:WARN Please initialize the log4j system properly.

log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

 

 

现象：

不打印log

 

方法一，通过classpath指定log4j.properties配置文件路径（是路径！）

java -classpath /path\_include\_log4j/conf

 

方法二，通过log4j.configuration指定文件路径，通过替换log4j文件占位符

java -Dlog.file=/tmp/local\_debug.log -Dlog4j.configuration=file:////path\_include\_log4j/conf/log4j.properties

 

注意：方法二必须file://开头