Buggy code:
class FileHandlerAdd implements ModelAddOperationHandler { static final FileHandlerAdd INSTANCE = new FileHandlerAdd ( ) ; @ Override public OperationResult execute ( final OperationContext context , final ModelNode operation , final ResultHandler resultHandler ) throws OperationFailedException { final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final String name = address . getLastElement ( ) . getValue ( ) ; final ModelNode compensatingOperation = new ModelNode ( ) ; compensatingOperation . get ( OP_ADDR ) . set ( operation . require ( OP_ADDR ) ) ; compensatingOperation . get ( OP ) . set ( REMOVE ) ; final ModelNode subModel = context . getSubModel ( ) ; subModel . get ( CommonAttributes . AUTOFLUSH ) . set ( operation . get ( CommonAttributes . AUTOFLUSH ) ) ; subModel . get ( CommonAttributes . ENCODING ) . set ( operation . get ( CommonAttributes . ENCODING ) ) ; subModel . get ( CommonAttributes . FORMATTER ) . set ( operation . get ( CommonAttributes . FORMATTER ) ) ; subModel . get ( CommonAttributes . LEVEL ) . set ( operation . get ( CommonAttributes . LEVEL ) ) ; subModel . get ( CommonAttributes . FILE ) . set ( operation . get ( CommonAttributes . FILE ) ) ; if ( ( context . getRuntimeContext ( ) ) != null ) { context . getRuntimeContext ( ) . setRuntimeTask ( new RuntimeTask ( ) { public void execute ( RuntimeTaskContext context ) throws OperationFailedException { final ServiceTarget serviceTarget = context . getServiceTarget ( ) ; try { final FileHandlerService service = new FileHandlerService ( ) ; final ServiceBuilder < Handler > serviceBuilder = serviceTarget . addService ( LogServices . handlerName ( name ) , service ) ; if ( operation . hasDefined ( CommonAttributes . FILE ) ) { final HandlerFileService fileService = new HandlerFileService ( operation . get ( CommonAttributes . FILE , CommonAttributes . PATH ) . asString ( ) ) ; final ServiceBuilder < ? > fileBuilder = serviceTarget . addService ( LogServices . handlerFileName ( name ) , fileService ) ; <START_BUG> if ( operation . hasDefined ( RELATIVE_TO ) ) { <END_BUG> fileBuilder . addDependency ( AbstractPathService . pathNameOf ( operation . get ( CommonAttributes . FILE , CommonAttributes . RELATIVE_TO ) . asString ( ) ) , String . class , fileService . getRelativeToInjector ( ) ) ; } fileBuilder . setInitialMode ( ACTIVE ) . install ( ) ; serviceBuilder . addDependency ( LogServices . handlerFileName ( name ) , String . class , service . getFileNameInjector ( ) ) ; } service . setLevel ( Level . parse ( operation . get ( CommonAttributes . LEVEL ) . asString ( ) ) ) ; final Boolean autoFlush = operation . get ( CommonAttributes . AUTOFLUSH ) . asBoolean ( ) ; if ( autoFlush != null ) service . setAutoflush ( autoFlush . booleanValue ( ) ) ; if ( operation . hasDefined ( CommonAttributes . ENCODING ) ) service . setEncoding ( operation . get ( CommonAttributes . ENCODING ) . asString ( ) ) ; if ( operation . hasDefined ( CommonAttributes . FORMATTER ) ) service . setFormatterSpec ( FileHandlerAdd . createFormatterSpec ( operation ) ) ; serviceBuilder . setInitialMode ( ACTIVE ) ; serviceBuilder . install ( ) ; } catch ( Throwable t ) { throw new OperationFailedException ( new ModelNode ( ) . set ( t . getLocalizedMessage ( ) ) ) ; } resultHandler . handleResultComplete ( ) ; } } ) ; } else { resultHandler . handleResultComplete ( ) ; } return new org . jboss . as . controller . BasicOperationResult ( compensatingOperation ) ; } static AbstractFormatterSpec createFormatterSpec ( final ModelNode operation ) { } }

Fix:
if ( operation . get ( CommonAttributes . FILE ) . hasDefined ( RELATIVE_TO ) ) {