GlassFish 4: How to rotate log every day - glassfish

I am using Glassfish 4. I would like to rotate the log every day. That means I like a new log for each day. I have tried changing properties at the admin console at http:localhost:4848 but it is not working for me. Here is what I have tried:
Configurations\default-config\Logger Settings and I set the checkbox for Rotation on Date Change
and also
Configurations\server-config\Logger Settings and I set the checkbox for Rotation on Date Change
Any help would be much appreciated. Thanks.

you can use asadmin from command line:
./asadmin --host localhost --port 4848 --user admin set-com.sun.enterprise.server.logging.GFFileHandler.rotationOnDateChange=true

If you want, you can to configure the retention log, using
asadmin> set-log-attributes
com.sun.enterprise.server.logging.GFFileHandler.maxHistoryFiles=10
Source

Related

Not able to login via SSH to GCP Compute Engine VM instance

My GCP VM instance was setup sometime back and all the services were working fine. However, suddenly from today I am not able to login via SSH and even an instance restart did not fix the issue. When checked the serial log, it seems to have stopped in this line,
[ 8.686861] intel_powerclamp: No package C-state
availableintel_powerclamp: No package C-state available[ 8.705723]
attempt to access beyond end of device [ 8.706721] sda1: rw=0,
want=41927608, limit=41927602 [[32m OK [0m] Started Security
Auditing Service.
Starting Update UTMP about System Boot/Shutdown...
32m OK [0m] Started Update UTMP about System Boot/Shutdown.
Starting Update UTMP about System Runlevel Changes...
32m OK [0m] Started Update UTMP about System Runlevel
ChanWelcome to emergency mode! AfterGive root password for maintenance
(or type Control-D to continue):
It won't proceed further to start SSH and other services, hence I am not able to login to the instance. Any help would be greatly appreciated.
Thanks in advance.
The error
No package C-state available
points to problems to mount the filesystem.
Did you try to follow the steps written in this other post ?
When you see Ctrl+D enter root password. Then enter mount -a to see in what line is the error.
Enter vi /etc/fstab and correct whatever is missing, save and reboot.
What you can do is logon to the serial console so you can interact with it. It will probably ask you for a root password and if you have not set that up, you can set that up through startup scripts.

Openshift connection error

I don't know if I'm on the right place but if not sorry in advance!
I have an app in openshift with tomcat running and since a couple days ago my app gives me "Not found" in the browser. I did restart the app in the webconsole and nothing.
So I thought that mybe the problem is in the tomcat so I tryed to check the log but I couldn't connect over ssh to the app. Then I runned again the setup to generate a new keypair but when the command rhc setup runs gives me:
Your private SSH key file should be set as readable only to yourself. Please
run 'chmod 600 C:\Users\Artur\.ssh\id_rsa'
An SSH connection could not be established to
standard-projectxserver.rhcloud.com. Your SSH configuration may not be correct,
or the application may not be responding. Authentication failed for user
XXXXX#standard-projectxserver.rhcloud.com
(Net::SSH::AuthenticationFailed)
Checking for a domain ... projectxserver
Checking for applications ... found 1
app http://app-projectxserver.rhcloud.com/
I search over the net I already set the keys manualy and in the ssh console gives me error and I cannot connect:
"Permission denied (publickey, gssapi-keyex,gssapi-with-mic)"
What I'm doing wrong? Or even better, what I can do to connect?
(I cannot recreate this app because the war I use I don't have anymore, so I need this working to save everything again!)
Thanks
Could you change permission on private key file via change mode command(chmod 600) as it is showing in error.
Your private SSH key file should be set as readable only to yourself.
Please run 'chmod 600 C:\Users\Artur.ssh\id_rsa'
otherwise you delete the existing public key from settings panel on openshift web console and create your keys with rhc setup command.
The problem was afterall in the openshift DNS!! they fixed that for me
Thanks for the effort

Bug? Cannot set persistent booleans without managed policy

I have an installation of Magneto, and it couldn't send any emails. Upon investigation, httpd_can_sendmail was turned off. This can be shown by getsebool -a | grep mail.
First I tried setsebool -P httpd_can_sendmail on, which gave me an error Cannot set persistent booleans without managed policy.
Then I read this article, and it's saying this is a bug and that it should really complain that you need root privileges. So sudo setsebool -P httpd_can_sendmail on turned it on.. The bug report is 4 years old, and this site is on Red Hat Enterprise Linux Server release 6.5 (Santiago) hosted on AWS. Is this error message simply just mis-worded? Should I have run that command as root?
this error message is right, because you need to have a privileged user to set selinux Properties.
If you not need to be privileged user, every user on the system can change selinux and so things you dont want.
I hope this answer is useful for you.
Switching to root did indeed clear the problem for me.

ZendServer 6 enable to open administration Console

I work on MacOS X.8 and since a couple of days each time I try to open administration console, this message display
Unable to connect to
http://localhost:10081
I can access the websites at 10088 just fine.. and all local test sites are working.
Do you know why?
Thanks for helping
There are few possible reasons to have that error:
You turned on your firewall on your mac? - Just disable and try again if this is the case...
Zend admin console's web server process is down/ not starting up. - In this case just open your terminal and type cd /usr/local/zend/bin/ and sudo ./zendctl.sh restart and watch for any errors if you get any.
Good luck.

Glassfish Logs in Idea 12

I am using GF 3 with Idea 12, and am unable to see the Glassfish logs without tailing them (Ubuntu) in the file system.
I have the checkbox activated as per the screenshot, but I still only see basic messages like these, but no debug or println messages.
Did I miss a step, or misread the doc?
Admin Port: 4848
Command start-domain executed successfully.
Connected to server
You can edit your application server's run/debug configuration in IDEA to automatically tail a particular log file (see the "Logs" tab in your server's run/debug config).
Also make sure that you did not filter logs using the "Log level" combobox in the upper right part of the tab which displays your logs.