I don't think the solution should come from the app code as the log4j2 starts writing before the app is complete up. "if you're watching multiple files, even if they're all in the same directory and being watched by the same watcher, you'll need a FileInfo instance for each file you're watching and your timer callback should refresh them all with each "tick"."Īm. Yes, the cat function on kudu command line also triggers the output which support the 2nd point above This forces the system to read from the file which triggers the onChange event. I'm guessing here that this is exactly what happen when I read the file via Kudu editor. They claim the read function will trigger the event, even a single byte read. For example this answer ended up writing a separate thread in order to read single byte from each file. More important this function - according to quite a few reports in stackoverflow- is not reliable function in order to monitor.So it basically uses only the default values It uses FileSystemWatcher to watch the folder for change. Moreover I looked into the Kudu/Logstream source code. If I open the kudu editor it triggers the output of the curl For some reason it does not show the output of tomcat logfiles in realtime. I connected to a linux server on azure and did curl. I have test in in several different times and its only output the log into the command line when I reenter the file via kudu file editor Edit 2 Summary: Any idea how to get real-time logging information? But without reentering the file there is no output to the console. It seems like accessing the file trigger an event change or something like that. But it refresh the output only when I access to the log file (e.g the debug.log) throw kudu system. It seems that azure cli should provide this kind of functionality. We are looking for a solution to do the same in azure as watching the logfiles in real-time is very critical to the development process. We just to tail on one of the log file or on catalina.out. We are checking possible move from Rackspace to Azure. We have debug.log, error.log and info.log. This works good and we have 3 files at LogFiles Directory. We output the log into `D:\home\LogFiles' Azure site log tail output new log information to stdout only when I reenter the log file via kudu editor
0 Comments
Leave a Reply. |