-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CustomAppender Example - Class Not Found #391
Comments
Probably the issue is that your naming is incorrect. The macro The code and config file go together, so they need to look something like this:
Note that the appender does not need to be in the |
I am using the configuration from the example, so the naming is correct. For the example, the macro is <appender
name="NullAppender"
class="NullWriterAppender">
<param
name="SomeValue"
value="Nothing" />
</appender>
<root>
<priority value="info" />
<appender-ref ref="NullAppender" />
</root> Does the namespace need to be included in the classname, if the custom class is defined outside of the root namespace (I have attempted this with no luck)? Is the something particular I need to do with cmake that may be causing the class not found issue? |
If you've tried that, the only other thing that I can think of is that the class might not be registering properly with log4cxx - this depends slightly on how log4cxx is built/the compiler. You can try registering the class manually, call the If that doesn't work, a minimal complete example would be helpful in order to debug what is going on. |
The example
The output should be:
|
Thanks, this solved my issue. This must be an issue with my cmake configuration or something of the sort. |
I'm attempting to create a custom layout to support RFC5424 (see #390), however, I receive a class not found error after compiling my layout and attempting to load the configuration. I attempted to replicate the example extension provided by documentation. However, after adding
using namespace log4cxx
to resolve the compiler errors with the code, I receive the following error:I copied custom-appender.cpp verbatim, and copied the
appender
andappender-ref
to my configuration file.Any guidance or suggestions would be appreciated.
I am using
Clang 14.0.6 x86_64-pc-linux-gnu
The text was updated successfully, but these errors were encountered: