Skip to content
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

Add Logging option that leverages Discriminators #448

Open
rlubke opened this issue Aug 5, 2021 · 0 comments
Open

Add Logging option that leverages Discriminators #448

rlubke opened this issue Aug 5, 2021 · 0 comments

Comments

@rlubke
Copy link
Contributor

rlubke commented Aug 5, 2021

Consider the following:

 public static CoherenceClusterResource s_coherence =
            new CoherenceClusterResource()
                    .with(CacheConfig.of("coherence-executor-cache-config.xml"),
                          SystemProperty.of("java.util.logging.config.class", "com.oracle.coherence.executor.logging.Config"),
                          Multicast.ttl(0),
                          LocalHost.only(),
                          Logging.at(9),
                          ClusterPort.of(7574),
                          ClusterName.of(TaskExecutorServiceClusterMemberTests.class.getSimpleName()),
                          Pof.config("coherence-executor-test-pof-config.xml"),
                          JmxFeature.enabled())
                    .include(STORAGE_ENABLED_MEMBER_COUNT,
                             DisplayName.of("CacheServer"),
                             RoleName.of("storage"),
                             LocalStorage.enabled(),
                             SystemProperty.of("coherence.extend.enabled", false))
                    .include(STORAGE_DISABLED_MEMBER_COUNT,
                             DisplayName.of("ComputeServer"),
                             RoleName.of("compute"),
                             LocalStorage.disabled(),
                             SystemProperty.of("coherence.extend.enabled", false));

If you review the code for DisplayName, you'll see the use of a discriminator when starting the cache server resulting in a display name of CacheServer-1 (as an example).

Logging allows for a destination, but it doesn't use a discriminator so both cache servers would write to the same log.

I wrote something specific (see attached) to my purposes that might be useful as a starting point.

Using the example above, I would use LogOutput like: LogOutput.to(m_testName.getMethodName(), "CacheServer")
while would result in CacheServer-1.log and CacheServer-2.log in a directory with the same name as m_testName.getMethodName()
LogOutput.java.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant