Home > Back-end >  How to debug information print to file, rather than in the console display
How to debug information print to file, rather than in the console display

Time:09-29

Programming in some debugging information to output to a log file,
Rookie question, had better have the code

CodePudding user response:

https://segmentfault.com/a/1190000002554165? Utm_medium=referral& Utm_source=tuicool
From baidu

CodePudding user response:

Debugging information refers to the here? Is a program using code output information? Or in the debug mode manual print information by yourself?
If the former, redirect the standard output and standard error of you directly to a file,
If the latter, it might be a little trouble, you is oneself use JDB to enter debug mode or in the IDE to enter debug mode?
If it is written in JDB, a shell or bat or using JDB + input redirection may do,
If is the IDE, the IDE console have provide export content to a file, if not can only copy and paste manually,

CodePudding user response:

The log? Grab a logging components to support ah, but you ask questions, so I'm not sure what's the effect you want.

CodePudding user response:

The log plug-in can ah, what do you need other information log level

CodePudding user response:

LogBack configuration
 & lt; ? The XML version="1.0" encoding="utf-8"?> 



% date {MM - dd yyyy - HH: MM: ss. The SSS} % 5 level thread] [% % logger. {56} % method: % L - % MSG % n




ERROR
DENY
ACCEPT



% date {MM - dd yyyy - HH: MM: ss. The SSS} % 5 level thread] [% % logger. {56} % method: % L - % MSG % n


App_log/log/app. Info. % d.l og



ERROR



% date {MM - dd yyyy - HH: MM: ss. The SSS} % 5 level thread] [% % logger. {56} % method: % L - % MSG % n



App_log/log/app. Err. % d.l og

And & lt; MaxHistory> 1, save only the last one month of file, delete the old files before - & gt;
1




CodePudding user response:

See what language you use, add the logging component output to a file, is simpler, baidu, a lot of reference example,
  • Related