Search Results

Search found 2 results on 1 pages for 'gammay'.

Page 1/1 | 1 

  • Logback: Logging with two loggers

    - by gammay
    I would like to use slf4j+logback for two purposes in my application - log and audit. For logging, I log the normal way: static final Logger logger = LoggerFactory.getLogger(Main.class); logger.debug("-> main()"); For Audit, I create a special named logger and log to it: static final Logger logger = LoggerFactory.getLogger("AUDIT_LOGGER"); Object[] params = { new Integer(1) /* TenantID */, new Integer(10) /* UserID */, msg}; logger.info("{}|{}|{}", params); logback configuration: <logger name="AUDIT_LOGGER" level="info"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d{HH:mm:ss.SSS}|%msg%n </pattern> </encoder> </appender> </logger> <root level="all"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n </pattern> </encoder> </appender> </root> Problem: Messages logged through audit logger appear twice - once under the AUDIT_LOGGER and once under the root logger. 14:41:57.975 [main] DEBUG com.gammay.example.Main - - main() 14:41:57.978|1|10|welcome to main 14:41:57.978 [main] INFO AUDIT_LOGGER - 1|10|welcome to main How can I make sure audit messages appear only once under the audit logger?

    Read the article

  • What am I doing wrong with my Shoes program?

    - by dmonroe4919
    #Shoes.app(:title => "Collinear Points", :width => 450, :height => 350) do def calculate math.sqrt(((@[email protected]_f)**2)+((@[email protected]_f)**2)+((@[email protected]_f)**2)) end def compute math.sqrt(((@[email protected]_f)**2)+((@[email protected]_f)**2)+((@[email protected]_f)**2)) end def capture math.sqrt(((@[email protected]_f)**2)+((@[email protected]_f)**2)+((@[email protected]_f)**2)) end stack(:width => '100%', :margin => 20) do para('Calculate Collinear Points') para(' x y z') end flow(:width => '100%' ) do para('Point A: ') @alphax = edit_line(:width => 100, height => 35) {@collinear.text = calculate} @alphay = edit_line(:width => 100, height => 35) {@collinear.text = calculate} @alphaz = edit_line(:width => 100, height => 35) {@collinear.text = calculate} end flow(:width => '100%' ) do para('Point B: ') @betax = edit_line(:width => 100, height => 35) {@collinear.text = compute} @betay = edit_line(:width => 100, height => 35) {@collinear.text = compute} @betaz = edit_line(:width => 100, height => 35) {@collinear.text = compute} end flow(:width => '100%' ) do para('Point C: ') @gammax = edit_line(:width => 100, height => 35) {@collinear.text = capture} @gammay = edit_line(:width => 100, height => 35) {@collinear.text = capture} @gammaz = edit_line(:width => 100, height => 35) {@collinear.text = capture} end button("Configure") @button.click do c = calculate+compute=capture case c when c=true alert("Points are collinear, equation is ") when c=false alert("Points are non-collinear") end end

    Read the article

1