---
title: "How to make log4j work with jetty?"  
description: "How to make log4j work with jetty?"  
author: "Anonymous User"  
published: 2015-12-14  
updated: 2015-12-14  
canonical: https://www.mindstick.com/forum/33727/how-to-make-log4j-work-with-jetty  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# How to make log4j work with jetty?

I want to make jetty [server](https://www.mindstick.com/articles/43769/what-is-serverless-architecture-is-it-worth-switching-over) [log](https://www.mindstick.com/articles/126269/the-main-uses-of-log-cabins) with log4j. When I use IDEA to [deploy](https://www.mindstick.com/interview/825/what-are-the-development-tools-and-operational-systems-that-dot-net-provides-to-build-deploy-and-integrate-applications) exploded war it works well. IDEA creates this [file](https://www.mindstick.com/articles/59/encrypting-and-decrypting-files-using-c-sharp) ([root](https://answers.mindstick.com/qa/49855/tell-me-what-is-root-port-in-spanning-tree-protocol).[xml](https://www.mindstick.com/blog/203/working-with-xml-data-in-sql-server)) in /tmp [directory](https://www.mindstick.com/forum/226/how-to-get-application-directory-using-c-sharp-csharp):\

```
<?xml version="1.0"  encoding="UTF-8"?><!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"><Configure class="org.eclipse.jetty.webapp.WebAppContext">    <Set name="contextPath">/</Set>    <Set name="resourceBase">/home/username/Desktop/project/ROOT/target/root</Set></Configure>
```

\
After I [copy](https://www.mindstick.com/forum/161993/explain-the-numpy-array-copy-vs-view-with-example) this file to /opt/jetty/webapps and restart jetty [service](https://www.mindstick.com/articles/105963/online-thesis-writing-service-for-college-kids-with-disabilities) it stops logging. I didn't change anything else in the [project](https://www.mindstick.com/articles/105927/how-to-excel-at-managing-multiple-projects). I didn't even change the directory, everything is the same.\
I just want to deploy without IDEA.\
How do I make log4j work with a manually deployed exploded war on Jetty 9 server?

## Replies

### Reply by Anonymous User

When you deploy from IDEA, it runs from a privileged user and has write access to the logs.\
The server has its own log files and its own user. It might not have proper rights to write the logs that you're checking. So you should check the server's own log files. Maybe you'll find there FileNotFoundException with Permission Denied. You need to give Jetty user rights to edit log files


---

Original Source: https://www.mindstick.com/forum/33727/how-to-make-log4j-work-with-jetty

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
