Grails 2.0: Disable All Logging for Resources - grails

Is it possible and how can I disable all logging for Resources? For example:
Error 2012-04-26 19:48:00,929 [pool-5-thread-1] ERROR
resource.ResourceMeta - While processing
/bundle-bundle_core_head.css, /css/main.css,
/lib/bootstrap/css/bootstrap.min.css, a resource was required but not
found: /images/go-dn-on.gif
I'm glad I have it so I can fix it, but I really want to stop it from showing up in log files, although I still need to show ERROR level from everything else.

In Config.groovy log4j section add line
off 'org.grails.plugin.resource.ResourceMeta'
Try the following for disable all logs
off 'grails.app.services.org.grails.plugin.resource',
'grails.app.taglib.org.grails.plugin.resource',
'grails.app.resourceMappers.org.grails.plugin.resource'

In appenders section of Config.groovy add following appender:
'null' name: 'empty'
Then, in log4j section redirect error messages from resource to this appender:
error empty: ['grails.app.services.org.grails.plugin.resource',
'grails.app.taglib.org.grails.plugin.resource',
'grails.app.resourceMappers.org.grails.plugin.resource']
This should do the trick.

Related

How to suppress exact message in log4j2?

How to suppress exact message in log4j2 ?
11:03:28.500 [main] DEBUG o.s.jdbc.datasource.init.ScriptUtils - SQLWarning ignored: SQL state '23000', error code '1062', message [Duplicate entry '888' for key 'PRIMARY']
Can I exclude based on strings included in message (like "Duplicate entry" or "error code '1062'")?
I've tried to find it in documentation of log4j2 configuration but failed.
I know that I could rewrite sql script.

log4j2.configurationFile does not accept yaml?

I migrated my old project from some SimpleLogger to Log4J. I hate Log4j because it is extremely difficult to set up.
Now, how do I feed some config into it?
Configuration:
status:info
name: YAMLConfigTest
thresholdFilter:
level: info
Appenders:
Console:
name: STDOUT
target: SYSTEM_OUT
PatternLayout:
Pattern: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
I tried loading it using the log4j2.configurationFile variable. But log4j always tries to interpret the file as XML. Why is that? Is there anything that I can do about it?
ERROR StatusLogger Error parsing /fullpath/log4j2.yaml
org.xml.sax.SAXParseException; systemId: file:///fullpath/log4j2.yaml; lineNumber: 1; columnNumber: 1; Content ist nicht zulässig in Prolog.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
...
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:599)
at de.tisje.dendro.plot.swing.Kurvenplot.<clinit>(Kurvenplot.java:91)
Alternative solution would be to put the file somewhere where it can be found automatically.
Where do I put the file in a standard eclipse/gradle project?
do I have to tell gradle how to handle it?
thanks
The XML ConfigurationFactory is a "catch-all" factory: it tries to read those files that were rejected by other configuration factories.
While the YAML configuration factory is distributed with log4j-core, it requires additional runtime dependencies to be active (this is mentioned briefly in the documentation). You need to add jackson-dataformat-yaml to your project.

Why Zerobranestudio Configuration error occurs?

Error while loading configuration file: 'cannot open C:\Users\안진형\Desktop\ZeroBraneStudio.zbstudio\user.lua: Invalid argument'.
Error while loading configuration file: cannot open C:\Users\안진형\Desktop\ZEROBR~1\cfg\tomorrow.lua: Invalid argument
What is "ZEROBR~1" in directory? and Why this message occurs?
I'm setting this program for code debugging and changeing color scheme of zerobranestudio, but I don't know how to open code file and how to change color scheme.
I've tried to do this and succeed to open tommorow.lua. Then Why this error message occurs?
How can i change color scheme?
http://bitstopixels.blogspot.com/2016/09/changing-color-theme-in-zerobrane-studio.html
I've tried this manual and succeed to open scheme-picker.lua. In that link's statement, If i choose color like "Tommorownightblue", Zerobranestudio's color changed to that color. But when i clicked "TommorownightBlue", Error while loading configuration file: cannot open C:\Users\안진형\Desktop\ZEROBR~1\cfg\tomorrow.lua: Invalid argument message occurs.
I'm not absolutely sure, but I'd try loading the configuration files from a different location. Can you move ZeroBrane Studio installation to a location that doesn't have your username in it, as I suspect it may be some encoding issue, which doesn't allow the file name to be properly passed to the open function.

contao theme installation issue . It shows could not find template

I am trying to install Contao theme on my hosting account, but I am getting an error message and am unable to solve the issue.
I read the log file but unable to figure out what is the actual issue.
This is the error that I see in my browser:
enter image description here
These are the errors from my log file:
[2019-02-18 04:34:44] request.INFO: Matched route "contao_frontend". {"route":"contao_frontend","route_parameters":{"_route":"contao_frontend","_token_check":true,"_controller":"Contao\CoreBundle\Controller\FrontendController::indexAction","_scope":"frontend","alias":"home-3"},"request_uri":"http://localhost/contao-sample/web/home-3.html","method":"HEAD"} []
[2019-02-18 04:34:44] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
[2019-02-18 04:34:44] request.INFO: Matched route "contao_frontend". {"route":"contao_frontend","route_parameters":{"_route":"contao_frontend","_token_check":true,"_controller":"Contao\CoreBundle\Controller\FrontendController::indexAction","_scope":"frontend","alias":"home-3"},"request_uri":"http://localhost/contao-sample/web/home-3.html","method":"GET"} []
[2019-02-18 04:34:44] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
[2019-02-18 04:34:45] request.CRITICAL: Uncaught PHP Exception Exception: "Could not find template "fe_page_extended"" at /opt/lampp/htdocs/contao-sample/vendor/contao/core-bundle/src/Resources/contao/library/Contao/TemplateLoader.php line 152 {"exception":"[object] (Exception(code: 0): Could not find template \"fe_page_extended\" at /opt/lampp/htdocs/contao-sample/vendor/contao/core-bundle/src/Resources/contao/library/Contao/TemplateLoader.php:152)"} []
The error message says that you are missing the template fe_page_extended, which you had selected in your page layout. May be you accidentally deleted it or missed it during a deployment. Simply edit your page layout(s) and save it again - or restore the missing template.

JasperReports in grails

I have installed jasper plugins for my grails application.
Then in the list.groovy page I have modify the code:
<g:paginate total="${Race.count()}" /> </div>
<g:jasperReport jasper="all-races" format="PDF" name="All Races" />
then I start the grails app. In list.gsp page, an pdf icon has been displayed. but when I click on it. it's showing error:
Error 500: Executing action [index] of controller [org.codehaus.groovy.grails.plugins.jasper.JasperController] in plugin [jasper] caused exception: null
Servlet: grails
URI: /cirnele/grails/jasper.dispatch
Exception Message: No such report spec: /reports/all-races (jasper or .jrxml)
Caused by: No such report spec: /reports/all-races (jasper or .jrxml)
Class: Unknown
At Line: [-1]
Code Snippet:
Actually I dont know how to use iReport to generate jasper file.
As the exception states, make sure you have your report generated in the directory you specified. You may want to take a look at this documentation.
Copy your .jrxml file into e.x grails-app\reports then add this line into your config.groovy or simply point it to the location of your report.
jasper.dir.reports = 'reports'

Resources