Skip to content

Commit 3d2e49b

Browse files
author
Alex Huang
committed
Changed the log4j config files to log org.apache.cloudstack in debug and change the layout format
1 parent c2752ba commit 3d2e49b

9 files changed

Lines changed: 173 additions & 83 deletions

File tree

client/tomcatconf/log4j-cloud.xml.in

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ under the License.
3535
<param name="ActiveFileName" value="@MSLOG@"/>
3636
</rollingPolicy>
3737
<layout class="org.apache.log4j.EnhancedPatternLayout">
38-
<param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{3}] (%t:%x) %m%n"/>
38+
<param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{1.}] (%t:%x) %m%n"/>
3939
</layout>
4040
</appender>
4141

@@ -47,7 +47,7 @@ under the License.
4747
<param name="ActiveFileName" value="@APISERVERLOG@"/>
4848
</rollingPolicy>
4949
<layout class="org.apache.log4j.EnhancedPatternLayout">
50-
<param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{3}] (%t:%x) %m%n"/>
50+
<param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{1.}] (%t:%x) %m%n"/>
5151
</layout>
5252
</appender>
5353

@@ -59,7 +59,7 @@ under the License.
5959
<param name="ActiveFileName" value="@AWSAPILOG@"/>
6060
</rollingPolicy>
6161
<layout class="org.apache.log4j.EnhancedPatternLayout">
62-
<param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{3}] (%t:%x) %m%n"/>
62+
<param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{1.}] (%t:%x) %m%n"/>
6363
</layout>
6464
</appender>
6565
<!-- ============================== -->
@@ -71,7 +71,7 @@ under the License.
7171
<param name="SyslogHost" value="localhost"/>
7272
<param name="Facility" value="LOCAL6"/>
7373
<layout class="org.apache.log4j.PatternLayout">
74-
<param name="ConversionPattern" value="%-5p [%c{3}] (%t:%x) %m%n"/>
74+
<param name="ConversionPattern" value="%-5p [%c{1.}] (%t:%x) %m%n"/>
7575
</layout>
7676
</appender>
7777

@@ -111,7 +111,7 @@ under the License.
111111
<param name="Target" value="System.out"/>
112112
<param name="Threshold" value="INFO"/>
113113
<layout class="org.apache.log4j.PatternLayout">
114-
<param name="ConversionPattern" value="%-5p [%c{3}] (%t:%x) %m%n"/>
114+
<param name="ConversionPattern" value="%-5p [%c{1.}] (%t:%x) %m%n"/>
115115
</layout>
116116
</appender>
117117

@@ -123,6 +123,10 @@ under the License.
123123
<priority value="DEBUG"/>
124124
</category>
125125

126+
<category name="org.apache.cloudstack">
127+
<priority value="DEBUG"/>
128+
</category>
129+
126130
<category name="org.apache.cloudstack">
127131
<priority value="DEBUG"/>
128132
</category>

framework/db/pom.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,22 @@
2222
<dependency>
2323
<groupId>javax.ejb</groupId>
2424
<artifactId>ejb-api</artifactId>
25-
<version>${cs.ejb.version}</version>
25+
</dependency>
26+
<dependency>
27+
<groupId>net.sf.ehcache</groupId>
28+
<artifactId>ehcache</artifactId>
2629
</dependency>
2730
<dependency>
2831
<groupId>org.eclipse.persistence</groupId>
2932
<artifactId>javax.persistence</artifactId>
30-
<version>${cs.jpa.version}</version>
33+
</dependency>
34+
<dependency>
35+
<groupId>commons-dbcp</groupId>
36+
<artifactId>commons-dbcp</artifactId>
37+
</dependency>
38+
<dependency>
39+
<groupId>commons-pool</groupId>
40+
<artifactId>commons-pool</artifactId>
3141
</dependency>
3242
<dependency>
3343
<groupId>org.apache.cloudstack</groupId>

plugins/hypervisors/kvm/pom.xml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
22
license agreements. See the NOTICE file distributed with this work for additional
3-
information regarding copyright ownership. The ASF licenses this file to
4-
you under the Apache License, Version 2.0 (the "License"); you may not use
5-
this file except in compliance with the License. You may obtain a copy of
6-
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
7-
by applicable law or agreed to in writing, software distributed under the
8-
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9-
OF ANY KIND, either express or implied. See the License for the specific
10-
language governing permissions and limitations under the License. -->
3+
information regarding copyright ownership. The ASF licenses this file to you under
4+
the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
Unless required by applicable law or agreed to in writing, software distributed under
7+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
8+
OF ANY KIND, either express or implied. See the License for the specific language
9+
governing permissions and limitations under the License. -->
1110
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1211
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1312
<modelVersion>4.0.0</modelVersion>
@@ -30,6 +29,10 @@
3029
</repository>
3130
</repositories>
3231
<dependencies>
32+
<dependency>
33+
<groupId>commons-io</groupId>
34+
<artifactId>commons-io</artifactId>
35+
</dependency>
3336
<dependency>
3437
<groupId>org.apache.cloudstack</groupId>
3538
<artifactId>cloud-agent</artifactId>

plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,12 @@
5050
import java.util.concurrent.ExecutorService;
5151
import java.util.concurrent.Executors;
5252
import java.util.concurrent.Future;
53-
import java.util.regex.Matcher;
54-
import java.util.regex.Pattern;
5553

5654
import javax.ejb.Local;
5755
import javax.naming.ConfigurationException;
5856

59-
import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
60-
import org.apache.cloudstack.storage.to.PrimaryDataStoreTO;
61-
import org.apache.cloudstack.storage.to.VolumeObjectTO;
62-
import org.apache.cloudstack.utils.qemu.QemuImg;
63-
import org.apache.cloudstack.utils.qemu.QemuImg.PhysicalDiskFormat;
64-
import org.apache.cloudstack.utils.qemu.QemuImgException;
65-
import org.apache.cloudstack.utils.qemu.QemuImgFile;
66-
import org.apache.log4j.Logger;
6757
import org.apache.commons.io.FileUtils;
58+
import org.apache.log4j.Logger;
6859
import org.libvirt.Connect;
6960
import org.libvirt.Domain;
7061
import org.libvirt.DomainBlockStats;
@@ -74,6 +65,14 @@
7465
import org.libvirt.LibvirtException;
7566
import org.libvirt.NodeInfo;
7667

68+
import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
69+
import org.apache.cloudstack.storage.to.PrimaryDataStoreTO;
70+
import org.apache.cloudstack.storage.to.VolumeObjectTO;
71+
import org.apache.cloudstack.utils.qemu.QemuImg;
72+
import org.apache.cloudstack.utils.qemu.QemuImg.PhysicalDiskFormat;
73+
import org.apache.cloudstack.utils.qemu.QemuImgException;
74+
import org.apache.cloudstack.utils.qemu.QemuImgFile;
75+
7776
import com.cloud.agent.api.Answer;
7877
import com.cloud.agent.api.AttachIsoCommand;
7978
import com.cloud.agent.api.AttachVolumeAnswer;
@@ -202,7 +201,6 @@
202201
import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.GuestResourceDef;
203202
import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InputDef;
204203
import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef;
205-
import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef.hostNicType;
206204
import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.SerialDef;
207205
import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.TermPolicy;
208206
import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.VirtioSerialDef;
@@ -240,7 +238,6 @@
240238
import com.cloud.vm.DiskProfile;
241239
import com.cloud.vm.VirtualMachine;
242240
import com.cloud.vm.VirtualMachine.State;
243-
import com.cloud.vm.VirtualMachineName;
244241

245242
/**
246243
* LibvirtComputingResource execute requests on the computing/routing host using
@@ -843,7 +840,7 @@ public boolean configure(String name, Map<String, Object> params)
843840

844841
configureVifDrivers(params);
845842

846-
KVMStorageProcessor storageProcessor = new KVMStorageProcessor(this._storagePoolMgr, this);
843+
KVMStorageProcessor storageProcessor = new KVMStorageProcessor(_storagePoolMgr, this);
847844
storageProcessor.configure(name, params);
848845
storageHandler = new StorageSubsystemCommandHandlerBase(storageProcessor);
849846

@@ -1254,7 +1251,7 @@ public Answer executeRequest(Command cmd) {
12541251
} else if (cmd instanceof NetworkRulesVmSecondaryIpCommand) {
12551252
return execute((NetworkRulesVmSecondaryIpCommand) cmd);
12561253
} else if (cmd instanceof StorageSubSystemCommand) {
1257-
return this.storageHandler.handleStorageCommands((StorageSubSystemCommand)cmd);
1254+
return storageHandler.handleStorageCommands((StorageSubSystemCommand)cmd);
12581255
} else if (cmd instanceof PvlanSetupCommand) {
12591256
return execute((PvlanSetupCommand) cmd);
12601257
} else {
@@ -3179,8 +3176,8 @@ protected LibvirtVMDef createVMFromSpec(VirtualMachineTO vmTO) {
31793176

31803177
if (vmTO.getMinRam() != vmTO.getMaxRam()){
31813178
grd.setMemBalloning(true);
3182-
grd.setCurrentMem((long)vmTO.getMinRam()/1024);
3183-
grd.setMemorySize((long)vmTO.getMaxRam()/1024);
3179+
grd.setCurrentMem(vmTO.getMinRam()/1024);
3180+
grd.setMemorySize(vmTO.getMaxRam()/1024);
31843181
}
31853182
else{
31863183
grd.setMemorySize(vmTO.getMaxRam() / 1024);

pom.xml

Lines changed: 116 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,121 @@
187187
<artifactId>log4j</artifactId>
188188
<version>${cs.log4j.version}</version>
189189
</dependency>
190+
<dependency>
191+
<groupId>org.springframework</groupId>
192+
<artifactId>spring-context</artifactId>
193+
<version>${org.springframework.version}</version>
194+
</dependency>
195+
<dependency>
196+
<groupId>cglib</groupId>
197+
<artifactId>cglib-nodep</artifactId>
198+
<version>${cs.cglib.version}</version>
199+
</dependency>
200+
<dependency>
201+
<groupId>commons-dbcp</groupId>
202+
<artifactId>commons-dbcp</artifactId>
203+
<version>${cs.dbcp.version}</version>
204+
<exclusions>
205+
<exclusion>
206+
<artifactId>commons-pool</artifactId>
207+
<groupId>commons-pool</groupId>
208+
</exclusion>
209+
</exclusions>
210+
</dependency>
211+
<dependency>
212+
<groupId>net.sf.ehcache</groupId>
213+
<artifactId>ehcache</artifactId>
214+
<version>${cs.ehcache.version}</version>
215+
</dependency>
216+
<dependency>
217+
<groupId>commons-pool</groupId>
218+
<artifactId>commons-pool</artifactId>
219+
<version>${cs.pool.version}</version>
220+
</dependency>
221+
<dependency>
222+
<groupId>commons-codec</groupId>
223+
<artifactId>commons-codec</artifactId>
224+
<version>${cs.codec.version}</version>
225+
</dependency>
226+
<dependency>
227+
<groupId>org.bouncycastle</groupId>
228+
<artifactId>bcprov-jdk16</artifactId>
229+
<version>${cs.bcprov.version}</version>
230+
</dependency>
231+
<dependency>
232+
<groupId>com.jcraft</groupId>
233+
<artifactId>jsch</artifactId>
234+
<version>${cs.jsch.version}</version>
235+
</dependency>
236+
<dependency>
237+
<groupId>org.jasypt</groupId>
238+
<artifactId>jasypt</artifactId>
239+
<version>${cs.jasypt.version}</version>
240+
</dependency>
241+
<dependency>
242+
<groupId>com.trilead</groupId>
243+
<artifactId>trilead-ssh2</artifactId>
244+
<version>${cs.trilead.version}</version>
245+
</dependency>
246+
<dependency>
247+
<groupId>com.amazonaws</groupId>
248+
<artifactId>aws-java-sdk</artifactId>
249+
<version>${cs.aws.sdk.version}</version>
250+
</dependency>
251+
<dependency>
252+
<groupId>log4j</groupId>
253+
<artifactId>apache-log4j-extras</artifactId>
254+
<version>${cs.log4j.extras.version}</version>
255+
<exclusions>
256+
<exclusion>
257+
<artifactId>log4j</artifactId>
258+
<groupId>log4j</groupId>
259+
</exclusion>
260+
</exclusions>
261+
</dependency>
262+
<dependency>
263+
<groupId>javax.ejb</groupId>
264+
<artifactId>ejb-api</artifactId>
265+
<version>${cs.ejb.version}</version>
266+
</dependency>
267+
<dependency>
268+
<groupId>com.googlecode.java-ipv6</groupId>
269+
<artifactId>java-ipv6</artifactId>
270+
<version>${cs.java-ipv6.version}</version>
271+
</dependency>
272+
<dependency>
273+
<groupId>commons-configuration</groupId>
274+
<artifactId>commons-configuration</artifactId>
275+
<version>${cs.configuration.version}</version>
276+
</dependency>
277+
<!-- Test dependency in mysql for db tests -->
278+
<dependency>
279+
<groupId>mysql</groupId>
280+
<artifactId>mysql-connector-java</artifactId>
281+
<version>${cs.mysql.version}</version>
282+
<scope>test</scope>
283+
</dependency>
284+
<dependency>
285+
<groupId>commons-io</groupId>
286+
<artifactId>commons-io</artifactId>
287+
<version>${cs.commons-io.version}</version>
288+
<scope>provided</scope>
289+
</dependency>
290+
<dependency>
291+
<groupId>org.reflections</groupId>
292+
<artifactId>reflections</artifactId>
293+
<version>${cs.reflections.version}</version>
294+
</dependency>
295+
<dependency>
296+
<groupId>org.owasp.esapi</groupId>
297+
<artifactId>esapi</artifactId>
298+
<version>2.0.1</version>
299+
</dependency>
300+
<dependency>
301+
<groupId>org.eclipse.persistence</groupId>
302+
<artifactId>javax.persistence</artifactId>
303+
<version>${cs.jpa.version}</version>
304+
</dependency>
190305
</dependencies>
191306
</dependencyManagement>
192307

@@ -245,7 +360,7 @@
245360
<excludeDefaultDirectories>true</excludeDefaultDirectories>
246361
<filesets>
247362
<fileset>
248-
<directory>target</directory>
363+
<directory>${cs.target.dir}</directory>
249364
<includes>
250365
<include>**/*</include>
251366
</includes>

server/conf/log4j-cloud.xml.in

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ under the License.
3434
<param name="ActiveFileName" value="@MSLOG@"/>
3535
</rollingPolicy>
3636
<layout class="org.apache.log4j.EnhancedPatternLayout">
37-
<param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{3}] (%t:%x) %m%n"/>
37+
<param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{1.}] (%t:%x) %m%n"/>
3838
</layout>
3939
</appender>
4040

@@ -46,7 +46,7 @@ under the License.
4646
<param name="ActiveFileName" value="@APISERVERLOG@"/>
4747
</rollingPolicy>
4848
<layout class="org.apache.log4j.EnhancedPatternLayout">
49-
<param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{3}] (%t:%x) %m%n"/>
49+
<param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{1.}] (%t:%x) %m%n"/>
5050
</layout>
5151
</appender>
5252

@@ -59,7 +59,7 @@ under the License.
5959
<param name="SyslogHost" value="localhost"/>
6060
<param name="Facility" value="LOCAL6"/>
6161
<layout class="org.apache.log4j.PatternLayout">
62-
<param name="ConversionPattern" value="%-5p [%c{3}] (%t:%x) %m%n"/>
62+
<param name="ConversionPattern" value="%-5p [%c{1.}] (%t:%x) %m%n"/>
6363
</layout>
6464
</appender>
6565

@@ -71,7 +71,7 @@ under the License.
7171
<param name="Target" value="System.out"/>
7272
<param name="Threshold" value="INFO"/>
7373
<layout class="org.apache.log4j.PatternLayout">
74-
<param name="ConversionPattern" value="%-5p [%c{3}] (%t:%x) %m%n"/>
74+
<param name="ConversionPattern" value="%-5p [%c{1.}] (%t:%x) %m%n"/>
7575
</layout>
7676
</appender>
7777

@@ -83,6 +83,10 @@ under the License.
8383
<priority value="DEBUG"/>
8484
</category>
8585

86+
<category name="org.apache.cloudstack">
87+
<priority value="DEBUG"/>
88+
</category
89+
8690
<!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
8791
<category name="org.apache">
8892
<priority value="INFO"/>

0 commit comments

Comments
 (0)