0

I am studying the logging structure used with CloudStack. I understand that it uses log4j to do the logging. log4j requires the use of configuration files to control what to log and where to log it. What I found is that the there was a combination of several log configuration files accross the log4j project along with the properties files that can be used to perform the tasks of a configuration file. What I want to understand is as follow:

1- CloudStack contains two types of configuration files which are "log4j-cloud.xml" and "log4j-cloud.xml.in". these two types of files are spread accross different projects and dosent contain the same information. What is the difference between these files, and what the "in" stand for.

2- What is being used by log4j to specify what to log and where to log it. Is it the cofiguration file or the properties file.

ChazLolo
  • 11
  • 1

1 Answers1

0
  1. The log4j-cloud.xml.in is the configuration file for console logging. This is where you should be setting your configuration

  2. log4j is used for cloudstack exception logging and the log4j.xml file is where you would configure that. You can find more information about cloudstack exception logging using log4j here https://cwiki.apache.org/confluence/display/CLOUDSTACK/Exceptions+and+logging

dreamwagon
  • 1,219
  • 1
  • 15
  • 17
  • When I took a look at the available log4-cloud.xml.in configuration files there were different levels specified beside the INFO level. It also specified file appenders similar to the log4j-cloud.xml configuration files, while other file appendars were different. So in this case would it log to these files appeanders and if not why did they use these appenders. They have also used log4j.properties file, if the log4j-cloud.xml is doing the same tasks that the log4j.properties file why are they using both. – ChazLolo Dec 01 '15 at 14:04
  • I understod that the ".in" file extension specifies an input file. What still confusess me that I am supposed to change the configuration using the "log4j-cloud.xml" but any changes I make in this file will not make a difference it will just be configured according to what is in the "log4j-cloud.xml.in" file. Can you please explain this in more detialies I might be missing something. – ChazLolo Dec 07 '15 at 10:55
  • What do you mean by "will not make a difference?" The log4j-cloud.xml.in is for console logging. This is where you should be setting your configuration. – dreamwagon Dec 07 '15 at 15:21