Hi everyone!
I was exploring logging strategies for projects that need to run all the time. It mainly comes out of a need to find if any errors are thrown by Processing/PApplet.
Here’s a gist/snippet of what I came up with.
It’s lacking log rotations and is being overwritten, but it’s a start.
What are your go-to strategies?
Renaud
Hi @renaudfv ,
I am not really familiar with logging in Java but here is a nice website that shows different solutions:
Guide and directory to Java logging frameworks, libraries and articles with links to popular logging tools, websites and tutorials including log4j, SLF4J, SmartInspect and more
One popular logging framework is Log4J (also known for a recent vulnerability )
Hi, @josephh thanks for the feedback.
If anyone is looking for a clear example using the native Java libs, here it is:
LoggingExemple.pde
import java.util.logging.*;
import java.util.Date;
// Main logger
Logger LOGGER = Logger.getLogger("");
MyCustomClass customInstance;
void setupLogging() {
This file has been truncated. show original
MyCustomClass.pde
class MyCustomClass {
int x;
int y;
// Class level logger
Logger logger = Logger.getLogger(MyCustomClass.class.getName());
MyCustomClass() {
this.x = 0;
this.y = 0;
This file has been truncated. show original
1 Like