How to turn off logging in log4c, which is the configuration parameter used in xml file - log4cxx

I am using log4c library with xml configuration log4crc and I need to figure out how to turn off/on logging.
I could not find any document explaining the parameters in log4crc configuration file,

try seeting the log priority to "notset"
If that doesn't work then make sure the system can't find your log configuration file and unset the environment variables LOG4C_APPENDER and LOG4C_PRIORITY

You could not turn off through set_priority() as log4c enum does not have support for OFF, where as avail in logj

Related

Can SSO config only import selective SettingsFileGenerator.xml settings?

The SettingsFileGenerator.xml file seems to have two purposes. One is to set the SSO Config and the other is to dynamically replace settings in the PortBindingsMaster.xml for each environment. I am replacing dozens of values in the PortBindingMaster.xml file that don't need to also be stored in the SSO config. Is there a standard way to specify which settings I want to be stored in the SSO config so I don't store a lot of extra values there?
Unfortunately, what you're asking is not directly supported. There a couple of workarounds though.
You can maintain a separate settings file for runtime only settings and use a custom CustomPostDeployTarget task to Exec SSOSettingsFileImport.exe with you runtime settings file.
Or, you can use a set of UpdateSSOConfigItem elements as referenced here: Deploy Configuration Settings into SSO.

How to change previous date log file permision to read only in Log4Net?

I am using Log4Net in my window application, Now i want to change the permission of my all previous date logs to read only automatically and only current date log file will remain same or not changed. How can i do this using Log4Net or is it possible in any other plugin like Elmah ?
This is not possible out of the box. You can invest to extend the file appender you are using to make the file ReadOnly when it is rolled. You can see the find the log4net source code here. Look for the appenders and then extend/ or copy that appender in you project. Make the changes and then use your own appender in the configuration.

How to set the os.environ for the nova-api?

I want to set the some variable in nova-api.
Which is the best way to set that? (in nova.conf or in other file?)
I can set in /etc/nova/nova.conf and get the value of that variable in the api. But is there any other way to set environment variable for the API? I want to access by os.environ in the script. (Is this the right way to access or not?)
As per my knowledge, for the wsgi we have to set in the apache's config file. But for nova I cant find the file :(.
Thanks in advance for the help.
Set the env variable from the init.d script. In the scrip /etc/init.d/openstack-nova-api one file is used /etc/sysconfig/$prog so we set the export variable in this file and got the reference later.

GET and .xq files

When using exist-db, a GET message will obtain an entire file from a collection (by providing the URI). In the case of a .xq file, however, the same GET message will instead execute the file.
I am wondering if there is anything I can attach to a GET message to cause exist-db to return the file rather than execute it. I should have all the necessary permissions, or I should be able to set them.
Thank you.
Assuming you are running eXist as a stand-alone server:
"GET accepts the following request parameters, which must be URL-encoded" _source=yes | no - which "Specifies whether the query should display its source code instead of being executed" - see the developers guide online for full details & example usage.
eXist sets this capability to 'no' as default in it's config - however you can override this permanently by adding specific files to the <allow-source></allow-source> section in the Web-application Descriptor file (descriptor.xml) read from WEB-INF directory of the web application or from the directory specified by the exist.home system property.
Hope that helps.

How to change configuration in memory

Im wondering if this is possible. I would really like to ship my application with no configuration file (stop users fiddling with it). Is it possible to set all the configuration in memory in say the global.asax (application_start) event? For example I dont want users messing directly with the connection string I want them to be able to modify it in the gui only. And i dont want to have to write to the config file as there may be security issues....
you could still use the file system and have the files encrypted. In this way only you can modify or from the app, but no one can really modify the configurations directly from the file. Also you could encrypt Configuration Sections: Check this Microsoft Link out.
Good luck!

Resources