How to format the wildfly/Jboss startup time in the log? - wildfly

The log of Wildfly shows the startup time in the format like started in 100000ms. The format I expected is ‘started in x minutes y seconds’, because ms unit is too long for a enterprise application. How to configure that?

Related

Fail2Ban not working on Ubuntu 16.04 (Date issues)

I have a problem with Fail2Ban
2018-02-23 18:23:48,727 fail2ban.datedetector [4859]: DEBUG Matched time template (?:DAY )?MON Day 24hour:Minute:Second(?:\.Microseconds)?(?: Year)?
2018-02-23 18:23:48,727 fail2ban.datedetector [4859]: DEBUG Got time 1519352628.000000 for "'Feb 23 10:23:48'" using template (?:DAY )?MON Day 24hour:Minute:Second(?:\.Microseconds)?(?: Year)?
2018-02-23 18:23:48,727 fail2ban.filter [4859]: DEBUG Processing line with time:1519352628.0 and ip:158.140.140.217
2018-02-23 18:23:48,727 fail2ban.filter [4859]: DEBUG Ignore line since time 1519352628.0 < 1519381428.727771 - 600
It says "ignoring Line" because the time skew is greater than the inspection period. However, this is not the case.
If indeed 1519352628.0 is derived from Feb 23, 10:23:48, then the other date: 1519381428.727771 must be wrong.
I have run tests for 'invalid user' hitting this repeatedly. But Fail2ban is always ignoring the line.
I am positive I am getting Filter Matches within 1 second.
This is Ubuntu 16.04 and Fail2ban 0.9.3
Thanks for any help you might have!
Looks like there is a time zone issue on your machine that might cause the confusion. Try to set the correct time zone and restart both rsyslogd and fail2ban.
Regarding your debug log:
1519352628.0 = Feb 23 02:23:48
-> timestamp parsed from line in log file with time Feb 23 10:23:48 - 08:00 time zone offset!
1519381428.727771 = Feb 23 10:23:48
-> timestamp of current time when fail2ban processed the log.
Coincidently this is the same time as the time in the log file. That's what makes it so confusing in this case.
1519381428.727771 - 600 = Feb 23 10:13:48
-> limit for how long to look backwards in time in the log file since you've set findtime = 10m in jail.conf.
Fail2ban 'correctly' ignores the log entry that appears to be older than 10 minutes, because of the set time zone -08:00.
btw:
If you need IPv6 support for banning, consider upgrading fail2ban to v0.10.x.
And there is also a brand new fail2ban version v0.11 (not yet marked stable, but running without issue for 1+ month on my machines) that has this wonderful new auto-increment bantime feature.

JPA Date is output to wrong date/time when running on Weblogic server, but displays correctly when running locally embedded Tomcat

I have a spring boot application using spring data to retrieve data from an Oracle database. When I run the code locally in embedded Tomcat, the date appears correctly. However, the same code when deployed to Weblogic server gives a completely different date/time result. I have confirmed that the timezone on the Weblogic server is the same as my local timezone (US/Eastern).
What is odd is that the minutes are being stripped out and always set to 00, and also the time difference between the correct date and the date displayed is unpredictable (one example is 16 hours behind, and with a different example, it's 19 hours)
jpa mapping:
import java.util.Date;
...
#Temporal(TemporalType.TIMESTAMP)
#Column(name = "INITIAL_CREATE_DATE")
private Date initialCreateDate;
controller log statement:
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm z");
...
log.info("~~create date: " + medley.getInitialCreateDate() + " sdf " + sdf.format(medley.getInitialCreateDate()));
output from Weblogic (WRONG):
~~create date: Thu Oct 26 20:00:00 EDT 2017 sdf 10/26/2017 08:00 EDT
output from local Tomcat and spring data unit tests (CORRECT):
~~create date: 2017-10-27 11:57:53.0 sdf 10/27/2017 11:57 EDT
Two things that stand out to me (besides the date/time being totally wrong)
1. The time is missing the minutes
2. The format is different on the .toString() output for the date
Any help or ideas how I can further troubleshoot this problem are very much appreciated!
I figured my problem out - posting my answer, maybe it will help someone else.
My "medley" object was not retrieved directly from the database here. It was retrieved by a job that then posted this medley object as JSON to this method here that outputs the date. While I still don't understand the odd date/time behavior, at least now I know the fix.
My previous version of the code was using #Temporal(TemporalType.DATE)
and serializing json as this...
"initialCreateDate": "2017-10-27",
which I don't understand why this was being converted to Thu Oct 26 20:00:00 - but at least I know that applying the #Temporal(TemporalType.TIMESTAMP) in my job fixed the problem. (i.e. updating the version of the repository code in pom.xml to the same version used by the service)
This is the correct serialization of the date/time:
"initialCreateDate":1509119873000

Is it possible to get rid of unwanted console messages in eclipse

Messages in my eclipse (testNG & selenium) projects are getting so much now that wanted outputs from sysout command are getting lost between them. This started recently. They were never these much. I heard there is a way to get rid of the unwanted warning messages or reduce them, at least. How can this be possibly achieved?
I get duplicates of messages like:
[BaseMessageSender] Connection established, starting reader thread
[BaseMessageSender] ReaderThread waiting for an admin message
[JsonMessageSender] Sending message [GenericMessage ==> suiteCount:1,
testCount:1]
TestNG] Time taken by org.testng.reporters.jq.Main#11531931: 80 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2#35bbe5e8: 19 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter#3f0ee7cb: 7 ms
TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 1 ms
[Utils] Attempting to create C:\Filepath\....
right click on the file you want to run ,then click on the Run Configurations then make sure verbose and Debug checkbox is unchecked .
image link

LogNotificationListener take a while on startup of Jboss

When I start my Jboss server (5.1), I have the following line in logs:
[LogNotificationListener] Adding notification listener for logging
mbean "jboss.system:service=Logging,type=Log4jService" to server
org.jboss.mx.server.MBeanServerImpl#1bfefb[ defaultDomain='jboss' ]
This line takes 30 seconds before to continue the startup.
I don't know what does this line (the code behind this line of course).
Why takes it a long time and what does it do ?
Thanks.
Enable DEBUG logging and you will see what's going on. Add to startup parameters
-Djboss.server.log.threshold=DEBUG
and you will see it in:
jboss-as/server/${profile}/log/server.log
Or change configuration to see it in console. Config file is here:
jboss-as/server/${profile}/conf/jboss-log4j.xml

Netbeans: project won't start all of a sudden - Glassfish problems?

I am a first time user of Netbeans, and was just playing around. I followed a very basic tutorial, and when I first ran the project, it opened up my browser (Chrome) and displayed what it should display.
The next day, I want to show it to my buddies, but the project won't start.
The project tab shows the following:
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
Starting GlassFish Server 3.1.2
and the other tab "Java DB Database Process" gives me the following:
Wed May 23 19:52:45 CEST 2012 : Sicherheitsmanager mit einfacher Server-Sicherheitsrichtlinie installiert.
Wed May 23 19:52:46 CEST 2012 : Apache Derby Network Server 10.8.1.2 - (1095077) wurde gestartet und ist bereit, Verbindungen am Port 1527 zu akzeptieren.
(the last line translates to "Server was started and is ready to accept connections in port 1527")
The only thing that was different when I tried it was the fact that I was in a public wireless net in University, and not at home. Windows Firewall asked me, if I wanted to grant permission, and I said "Yes"
So basically Netbeans tells me that my project is currently in the process of being started, but nothing happens for ages.
Any ideas what I could possibly have done wrong? I googled the heck out of it, but found nothing.
EDIT: After 20 minutes I get a timeout and a message that the server couldn't be started. I am clueless...
The different network configuration can indeed be a reason for this issue.
You could verify this by either checking the server.log under:
glassfish-install-dir/glassfish/domains/domain1/config/server.log
Scroll down to the last log entry before server start stopped.
Or you can start your server manually in verbose mode. Then you will see all log messages in the console:
Open a console window and switch to the following directory:
glassfish-install-dir/bin
Then enter the following command:
asadmin start-domain --verbose=true