RE: how to make log and log level default

Jamie Sammons, modified 2 Years ago. Expert Posts: 327 Join Date: 12/20/10 Recent Posts

hi 

i can add log and config log level, configuring-logging

my problem is, every time i deploy my project or restart server, all log i created will be gone and i have to create them one by one again.

is there any passable to make it default? i mean, just like "aQute.bnd.osgi", always there.

thanks in advance.

thumbnail
Jamie Sammons, modified 2 Years ago. Expert Posts: 308 Join Date: 2/13/13 Recent Posts

There's nothing out of the box for this, Scarletake, though I can tell you it's been discussed internally. I don't know if it helps but there's a new way to set log levels that can involve less point-and-click: the Gogo shell. See this commit for information (an official documentation ticket is created but not worked on yet because of prioritization).

I don't know if you can invoke gogo commands from a Groovy script or Java inside an OSGi module, but if so you could create a logger script or module to adjust the log levels however you want.

thumbnail
Jamie Sammons, modified 2 Years ago. Liferay Master Posts: 593 Join Date: 8/8/14 Recent Posts
Jamie Sammons, modified 2 Years ago. Expert Posts: 327 Join Date: 12/20/10 Recent Posts

hi Russell and Mohammed

i find by myself, i do believe it's not a good one, but it salved my porblem.

i modified portal-log4j.xml of portal-impl.jar, restart server.

it so virulent, violence, it works, for now.

thank you.