---
title: "LOG4J在junit中自动加载"
author: "jdkleo"
date: "2018-04-13T13:44:08Z"
tags: []
categories: ["编程语言"]
slug: "log4j-junit"
draft: false
lastmod: "2018-04-13T13:44:17Z"
id: 2418516
url: "https://jdkleo.iteye.com/blog/2418516"
---

```
InputStream log4j = Yourclass.class.getClass().getResourceAsStream("/log4j.properties");
PropertyConfigurator.configure(log4j);
```