Assuming you are using JDBCAppender, I depends on two things:
- Are you sharing the database connection of your application with log4j? By default, you are not. In fact, you would have to try very hard to accomplish this. So, failures on the logging connection will not impact transactions on the business DB connection.
- If you are sharing a JDBC connection, then it depends on the autoCommit setting of that connection. If autoCommit is true, logging errors will not affect business transactions even on the same connection.