Progressive Web Apps: Create a Universal Experience Across All Devices

Welcome the progressive web application—a way to create a universal experience across mobile and desktop alike and to view and utilize the web in a completely new way while increasing your marketability.
However, what you should know is that many of the standards that make progressive web applications possible are not new, but with the emergence of key technologies such as the service worker, PWAs are more poised than ever to create scalable, reliable, and flexible experiences within the browser.

My SimpleLogger can be a Replacement for Log4J

In this blog post, don’t get me wrong, I think Log4J is a great product and I am not trying to discourage anyone from using it.

I have used Log4J v1.x on hundreds of projects for customers and myself. It has always worked exactly as expected. I have never used Log4J v2.x, so I cannot/will not comment on the current security vulnerability that has been discovered.

All of the logging I have configured for use with Log4J has been extremely basic. I use the basic appender and have it write to a file. That’s it. Basically, I am using probably 5% of the available features. So, over time, I have been slowing moving away from Log4J and just using my own simple logger because that is all I have ever needed.

So, this week I spent some time prettying up my SimpleLogger code. It was written in a similar style to Log4J but there is no configuration file for it. The code is thread-safe and can be used in any project that requires simple logging code.

public static void setLogFile(String logFileName)
public static void setLogFile(String logFileName, String logDirectory)
public static void close()
public static void setIncludePackageName(boolean flag)
public static void setLevel(LogLevel ll)
public static void setMaxBackupFiles(int maxCount)
public static void setMaxFileSize(int maxSize)
public static void setRotationType(LogRotationType rt)
public static void error(Object data)
public static void warn(Object data)
public static void info(Object data)
public static void debug(Object data)
public static void errorDump(String title, Object data)
public static void warnDump(String title, Object data)
public static void infoDump(String title, Object data)
public static void debugDump(String title, Object data)

Here is a simple tester Java program that shows how to use the various methods:

package com.capitalware.logging;

import com.capitalware.logging.SimpleLogger.*;

/**
* This class will test the SimpleLogger class.
*
* @author Roger Lacroix, Capitalware Inc.
* @version 1.0.0
* @license Apache 2 License
*/
public class Test_Logger
{
public Test_Logger()
{
SimpleLogger.setLogFile(“Test_Logger.log”, “C:\temp\”);
SimpleLogger.setLevel(LogLevel.DEBUG);
SimpleLogger.setRotationType(LogRotationType.SIZE);
SimpleLogger.setIncludePackageName(false);

SimpleLogger.error(“this is a test message for error.”);
SimpleLogger.warn(“this is a test message for warn.”);
SimpleLogger.info(“this is a test message for info.”);
SimpleLogger.debug(“this is a test message for debug.”);

SimpleLogger.debugDump(“Kids song”, “Mary had a little lamb, Little lamb, little lamb, Mary had a little lamb Whose fleece was white as snow.”.getBytes());

SimpleLogger.close();
}

public static void main(String[] args)
{
new Test_Logger();
}
}

Here’s what the output looks like in the log file:

2021/12/15 20:27:58.187 ERROR (Test_Logger.<init>) this is a test message for error.
2021/12/15 20:27:58.188 WARN (Test_Logger.<init>) this is a test message for warn.
2021/12/15 20:27:58.188 INFO (Test_Logger.<init>) this is a test message for info.
2021/12/15 20:27:58.188 DEBUG (Test_Logger.<init>) this is a test message for debug.
2021/12/15 20:27:58.188 DEBUG (Test_Logger.<init>) Kids song –>>
2021/12/15 20:27:58.188 DEBUG (Test_Logger.<init>) 000000: 4D617279 20686164 2061206C 6974746C 65206C61 6D622C20 4C697474 6C65206C Mary had a little lamb, Little l
2021/12/15 20:27:58.188 DEBUG (Test_Logger.<init>) 000020: 616D622C 206C6974 746C6520 6C616D62 2C204D61 72792068 61642061 206C6974 amb, little lamb, Mary had a lit
2021/12/15 20:27:58.188 DEBUG (Test_Logger.<init>) 000040: 746C6520 6C616D62 2057686F 73652066 6C656563 65207761 73207768 69746520 tle lamb Whose fleece was white
2021/12/15 20:27:58.188 DEBUG (Test_Logger.<init>) 000060: 61732073 6E6F772E as snow.
2021/12/15 20:27:58.188 DEBUG (Test_Logger.<init>) <<—–

I have generated the JavaDocs for the SimpleLogger class and created a JAR file for SimpleLogger for users to use. I zipped up the JavaDocs, JAR file and the source code for both Test_SimpleLogger.java program and SimpleLogger.java. You can download the it from here.

Simply add the SimpleLogger JAR file to your application or add the SimpleLogger source code to your utility (or handler) package of your application and then start using it.

Regards,
Roger Lacroix
Capitalware Inc.

Many organizations are navigating #modernization options for the #ibmi . This Wednesday, join @freschesolution and @forrester as we help to break down some of the questions you should be askign as you plan.

Many organizations are navigating #modernization options for the #ibmi . This Wednesday, join @freschesolution and @forrester as we help to break down some of the questions you should be askign as you plan. twitter.com/freschesolutio…

– Kimberly O’Dea (@KimberlyODea1)08:18 – Dec 13, 2021Quoted Tweet:

Registered yet? hubs.ly/Q010FxJv0
Live Session: Chris Koppe and ft. speaker William Martorelli from Forrester on December 15, 1 pm EDT. They’ll discuss the latest market trends & technologies being adopted & why. Chris’ll also dive into 3 real-world IBM i customer roadmaps pic.twitter.com/S9vXp8mwTD

– Fresche Solutions (@freschesolution)06:50 – Dec 13, 2021

#IBMPower Systems – 2021 Year-end Announcement Review. Ron Gordon, #IBMChampion, reviews #PowerSystems announcements in hardware, software, cloud, and management capabilities.

#IBMPower Systems – 2021 Year-end Announcement Review. Ron Gordon, #IBMChampion, reviews #PowerSystems announcements in hardware, software, cloud, and management capabilities. mainline.com/blog-ibm-power… #ibmsystems pic.twitter.com/inONLrxTV3

– Mainline (@MainlineInfoSys)07:52 – Dec 13, 2021

Our top #IBMi advisors are now available to you for free consultations – they can help you validate roadmaps, explore new growth opportunities and solve key challenges. Schedule a one-on-one with them – it could change your business & your future!

Our top #IBMi advisors are now available to you for free consultations – they can help you validate roadmaps, explore new growth opportunities and solve key challenges. Schedule a one-on-one with them – it could change your business & your future! hubs.ly/H0_xpR30 pic.twitter.com/6K2spSF4Vp

– Fresche Solutions (@freschesolution)06:51 – Dec 13, 2021

Verified by MonsterInsights