简体   繁体   English

小程序中的客户端登录

[英]Client Side logging in Applet

I have an applet which runs on the client machine. 我有一个在客户端计算机上运行的小程序。 I want to obtain logs or store logs on client side. 我想获取日志或将日志存储在客户端。 I know Java console shows all the errors/exceptions. 我知道Java控制台会显示所有错误/异常。

Any way I can store those logs in a file? 有什么办法可以将这些日志存储在文件中?

Any way I can store those logs in a file? 有什么办法可以将这些日志存储在文件中?

Sure. 当然。 So long as the applet is trusted, it should be able to write files under (at least) the user.home path. 只要该applet受信任,它就应该能够(至少)在user.home路径下写入文件。 A trusted app. 受信任的应用程序。 can also redirect System.out and System.err streams to wherever they are needed. 还可以将System.outSystem.err流重定向到所需的任何位置。

But then, why is the logging API dumping info. 但是,为什么日志记录API转储信息。 to the console or standard out? 到控制台还是标准输出? Surely it has a facility to put the output wherever and however the user (the programmer) wants. 当然,它具有将输出放置在任何地方的功能,而无论用户(程序员)想要什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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