简体   繁体   中英

flink logging to file for user code not working

I'm new to Flink, so this question could be quite simple...

Flink version is 1.5.0.

I created a sample project, copy SocketWindowWordCount from Flink sample code.

My pom.xml file is copy from official site: here

I just add some smiple log.info(...) statements. No matter I add a log4j.properties in project resources folder, or modify log4j-cli.properties in flink conf folder. The log I added won't output to log file.

log4j-cli.properties modification:

log4j.logger.test.flink=INFO, file, console

After add this line in log4j-cli.properties, I can see logs in console, but still not appear in both jobmanager.log and taskmanager.log.

I'm using flink run to submit:

flink run -m yarn-cluster -yn=2 test.jar

Appreciate any help. Thanks.

I found the log location.

On yarn application main page: localhost:8080, click application ID to enter applicaition overview page, then click logs link, just can see jobmananger.err, jobmananger.log, jobmananger.out, 3 links.

But my log is in taskmanager.log. Click locahost:8042 link to enter node manager page, then click "list of containers" on left menu, then can find taskmanager.log in relative container.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM